Networking And Communications

TCP/IP Networking For Developers


TCP/IP architectural model



The TCP/IP protocol suite is so named for two of its most important protocols: Transmission Control Protocol (TCP) and Internet Protocol (IP). A less used name for it is the Internet Protocol Suite, which is the phrase used in official Internet standards documents. In this book, we use the more common, shorter term, TCP/IP, to refer to the entire protocol suite.


The main design goal of TCP/IP was to build an interconnection of networks, referred to as an  internetwork, or internet, that provided universal communication services over heterogeneous physical networks. The clear benefit of such an internetwork is the enabling of communication between hosts on different networks, perhaps separated by a large geographical area.

The words internetwork and internet are simply a contraction of the phrase interconnected network. However, when written with a capital “I”, the Internet refers to the worldwide set of interconnected networks. Therefore, the Internet is an internet, but the reverse does not apply. The Internet is sometimes called the connected Internet.











TCP/IP protocol layers And Applications



TCP/IP is modeled in layers. This layered representation leads to the term protocol stack, which refers to the stack of layers in the protocol suite. It can be used for positioning (but not for functionally comparing) the TCP/IP protocol suite against others, such as Systems Network Architecture (SNA) and the Open System Interconnection (OSI) model.


















Application layer



The application layer is provided by the program that uses TCP/IP for communication. An application is a user process cooperating with another process usually on a different host (there is also a benefit to application communication within a single host). Examples of applications include Telnet and the File Transfer Protocol (FTP). The interface between the application and transport layers is defined by port numbers and sockets



Applications:

The highest-level protocols within the TCP/IP protocol stack are application
protocols. They communicate with applications on other internet hosts and are
the user-visible interface to the TCP/IP protocol suite.



  • Telnet for interactive terminal access to remote internet hosts
  • File Transfer Protocol (FTP) for high-speed disk-to-disk file transfers
  • Simple Mail Transfer Protocol (SMTP) as an internet mailing system




Transport layer


The transport layer provides the end-to-end data transfer by delivering data from an application to its remote peer. Multiple applications can be supported simultaneously. The most-used transport layer protocol is the Transmission Control Protocol (TCP), which provides connection-oriented reliable data delivery, duplicate data suppression, congestion control, and flow control


Another transport layer protocol is the User Datagram Protocol (see 4.2, “User Datagram Protocol (UDP)” on page 146). It provides connectionless, unreliable
best-effort service. As a result, applications using UDP as the transport protocol have to provide their own end-to-end integrity, flow control, and congestion
control, if desired. Usually, UDP is used by applications that need a fast transport mechanism and can tolerate the loss of some data.



Applications:

They use either UDP or TCP as a transport mechanism. Remember that UDP
is unreliable and offers no flow-control, so in this case, the application has to provide its own error recovery, flow control, and congestion controlfunctionality. It is often easier to build applications on top of TCP because it is a reliable stream, connection-oriented, congestion-friendly, flow control-enabled protocol. As a result, most application protocols will use TCP, but there are applications built on UDP to achieve better performance through increased protocol efficiencies.




Internetwork layer


The internetwork layer, also called the internet layer or the network layer, provides the “virtual network” image of an internet (this layer shields the higher
levels from the physical network architecture below it). Internet Protocol (IP) is the most important protocol in this layer. It is a connectionless protocol that does not assume reliability from lower layers. IP does not provide reliability, flow control, or error recovery. These functions must be provided at a
higher level.


IP provides a routing function that attempts to deliver transmitted messages to their destination. A message unit in an IP network is called an IP datagram. This is the basic unit of information transmitted across TCP/IP networks. Other internetwork-layer protocols are IP, ICMP, IGMP, ARP, and RARP.




Network interface layer


The network interface layer, also called the link layer or the data-link layer, is the interface to the actual network hardware. This interface may or may not
provide reliable delivery, and may be packet or stream oriented. In fact, TCP/IP does not specify any protocol here, but can use almost any network interface
available, which illustrates the flexibility of the IP layer. Examples are IEEE 802.2, X.25 (which is reliable in itself), ATM, FDDI, and even SNA









Networking Basics








































































































Name Resolution























































































This command will show all the DNS caching information











Windows HOST file configuration




The short answer is that the Hosts file is like an address book. When you type an address like www.yahoo.com into your browser, the Hosts file is consulted to see if you have the IP address, or "telephone number," for that site. If you do, then your computer will "call it" and the site will open. If not, your computer will ask your ISP's (internet service provider) computer for the phone number before it can "call" that site. Most of the time, you do not have addresses in your "address book," because you have not put any there. Therefore, most of the time your computer asks for the IP address from your ISP to find sites.

If you put ad server names into your Hosts file with your own computer's IP address, your computer will never be able to contact the ad server. It will try to, but it will be simply calling itself and get a "busy signal" of sorts. Your computer will then give up calling the ad server and no ads will be loaded, nor will any tracking take place. Your choices for blocking sites are not just limited to blocking ad servers. You may block sites that serve advertisements, sites that serve objectionable content, or any other site that you choose to block.






































DNS Record Type


To Get Name Server info.






To get the Email Server Details









To get the IPv6 server Address info.







Wildcard DNS Record Type











Review of DNS Trace via WireShark














IP Routing











































































































































































Port Connectivity


























Test the PORT Connectivity of TCP






























To get which process is listening at which PORT of current  working host




















To change the Firewall settings of working host




































Network Capture





Free Application to trace network traffic at Network Interface of working host









Free Application to trace HTTP traffic on your host












Network Data Exchange Methods


Kind of Computer Networks Groups

A workgroup is a type of peer-to-peer network. It is essentially the name for a Windows based peer-to-peer computer network. Computers in this kind of network can allow each other access to their files, printers, or Internet connection.  A peer-to-peer network can’t have a domain because it doesn’t have a dedicated server computer to act as a domain controller. Instead, computers in a peer-to-peer network are grouped in workgroups, which are simply groups of computers that can share resources with each other. Each computer in a workgroup keeps track of its own user accounts and security settings, so no single computer is in charge of the workgroup.
 
 
 
 
A domain, on the other hand, is a client/server network in which the security and resource management is centralized. This means that a singular administration has control over the domain and allows which users have access to which files. In a Windows network, a domain is a group of server computers that share a common user account database. A user at a client computer can log in to a domain to access shared resources for any server in the domain. Each domain must have at least one server computer designated as the domain controller, which is ultimately in charge of the domain.  Most domain networks share this work among at least two domain controllers, so that if one of the controllers stops working, the network can still function.

 

Active Directory

Active Directory (AD) is a directory service implemented by Microsoft for Windows domain networks. It is included in most Windows Server operating systems.

An AD domain controller authenticates and authorizes all users and computers in a Windows domain type network—assigning and enforcing security policies for all computers and installing or updating software. For example, when a user logs into a computer that is part of a Windows domain, Active Directory checks the submitted password and determines whether the user is a system administrator or normal user.[1]

Active Directory makes use of Lightweight Directory Access Protocol (LDAP) versions 2 and 3, Microsoft's version of Kerberos, and DNS

 



 


Client Server Communication












Inter-process communication



In computing, inter-process communication (IPC) is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared memory, and remote procedure calls (RPC). The method of IPC used may vary based on the bandwidth and latency of communication between the threads, and the type of data being communicated.



There are several reasons for providing an environment that allows process cooperation:
IPC may also be referred to as inter-thread communication and inter-application communication.







Implementations



There are several APIs which may be used for IPC. A number of platform independent APIs include the following:
The following are platform or programming language specific APIs:



Examples of IPC Implementation

Remote procedure call


In computer science, a remote procedure call (RPC) is an inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another address space (commonly on another computer on a shared network) without the programmer explicitly coding the details for this remote interaction. That is, the programmer writes essentially the same code whether the subroutine is local to the executing program, or remote. When the software in question uses object-oriented principles, RPC is called remote invocation or remote method invocation.

An RPC is initiated by the client, which sends a request message to a known remote server to execute a specified procedure with supplied parameters. The remote server sends a response to the client, and the application continues its process. While the server is processing the call, the client is blocked (it waits until the server has finished processing before resuming execution), unless the client sends an asynchronous request to the server, such as an XHTTP call. There are many variations and subtleties in various implementations, resulting in a variety of different (incompatible) RPC protocols.
An important difference between remote procedure calls and local calls is that remote calls can fail because of unpredictable network problems.


Sequence of events during a RPC

  1. The client calls the client stub. The call is a local procedure call, with parameters pushed on to the stack in the normal way.
  2. The client stub packs the parameters into a message and makes a system call to send the message. Packing the parameters is called marshalling.
  3. The client's local operating system sends the message from the client machine to the server machine.
  4. The local operating system on the server machine passes the incoming packets to the server stub.
  5. The server stub unpacks the parameters from the message . Unpacking the parameters is called unmarshalling.
  6. Finally, the server stub calls the server procedure. The reply traces the same steps in the reverse direction.


Other RPC analogues

RPC analogues found elsewhere:
  • Java's Java Remote Method Invocation (Java RMI) API provides similar functionality to standard Unix RPC methods.
  • Modula-3's network objects, which were the basis for Java's RMI[5]
  • XML-RPC is an RPC protocol that uses XML to encode its calls and HTTP as a transport mechanism.
  • JSON-RPC is an RPC protocol that uses JSON-encoded messages
  • JSON-WSP is an RPC protocol that uses JSON-encoded messages
  • SOAP is a successor of XML-RPC and also uses XML to encode its HTTP-based calls.
  • RPyC implements RPC mechanisms in Python, with support for asynchronous calls.
  • Spyne defines primitives for doing RPC in Python. It also contains implementations of some of the most popular protocols and transports.[6]
  • Pyro object-oriented form of RPC for Python.
  • ZeroC's Internet Communications Engine (Ice) distributed computing platform.
  • Etch framework for building network services.
  • Facebook's Thrift protocol and framework.
  • BERT-RPC is an RPC protocol in use by Github [7][8]
  • CORBA provides remote procedure invocation through an intermediate layer called the object request broker.
  • Distributed Ruby (DRb) allows Ruby programs to communicate with each other on the same machine or over a network. DRb uses remote method invocation (RMI) to pass commands and data between processes.
  • Action Message Format (AMF) allows Adobe Flex applications to communicate with back-ends or other applications that support AMF.
  • Libevent provides a framework for creating RPC servers and clients.[9]
  • Windows Communication Foundation is an application programming interface in the .NET framework for building connected, service-oriented applications.
  • Microsoft .NET Remoting offers RPC facilities for distributed systems implemented on the Windows platform. It has been superseded by WCF.
  • The deprecated Microsoft DCOM uses MSRPC which is based on DCE/RPC
  • The Open Software Foundation DCE/RPC Distributed Computing Environment (also implemented by Microsoft).
  • Google Protocol Buffers (protobufs) package includes an interface definition language used for its RPC protocols.[10]
  • Google Web Toolkit uses an asynchronous RPC to communicate the server service.[11]
  • Apache Avro provides RPC where client and server exchange schemas in the connection handshake and code generation is not required.
  • Spike-Engine provides cross platform RPC facilities for .NET framework, web and mobile architectures with auto-generated stubs.
  • Twitter Finagle is a network stack for the JVM that you can use to build asynchronous Remote Procedure Call (RPC) clients and servers in Java, Scala, or any JVM-hosted language.




Sockets and Socket-based Communication











.NET Remoting


NET Remoting is a Microsoft application programming interface (API) for interprocess communication released in 2002 with the 1.0 version of .NET Framework. It is one in a series of Microsoft technologies that began in 1990 with the first version of Object Linking and Embedding (OLE) for 16-bit Windows. Intermediate steps in the development of these technologies were Component Object Model (COM) released in 1993 and updated in 1995 as COM-95, Distributed Component Object Model (DCOM), released in 1997 (and renamed Active X), and COM+ with its Microsoft Transaction Server (MTS), released in 2000.[1] It is now superseded by Windows Communication Foundation (WCF), which is part of the .NET Framework 3.0.
 
Like its family members and similar technologies such as Common Object Request Broker Architecture (CORBA) and Java's remote method invocation (RMI), .NET Remoting is complex, yet its essence is straightforward. With the assistance of operating system and network agents, a client process sends a message to a server process and receives a reply.[2][3]

.NET Remoting allows an application to make an object (termed remotable object) available across remoting boundaries, which includes different appdomains, processes or even different computers connected by a network.[4] The .NET Remoting runtime hosts the listener for requests to the object in the appdomain of the server application. At the client end, any requests to the remotable object are proxied by the .NET Remoting runtime over Channel objects, that encapsulate the actual transport mode, including TCP streams, HTTP streams and named pipes. As a result, by instantiating proper Channel objects, a .NET Remoting application can be made to support different communication protocols without recompiling the application. The runtime itself manages the act of serialization and marshalling of objects across the client and server appdomains.[4]








Web service


A web service is a method of communication between two electronic devices over the World Wide Web. A web service is a software function provided at a network address over the web or the cloud; it is a service that is "always on" as in the concept of utility computing.



The W3C defines a "Web service" as:
[...] a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.[1]
The W3C also states:
We can identify two major classes of Web services:
  • REST-compliant Web services, in which the primary purpose of the service is to manipulate XML representations of Web resources using a uniform set of "stateless" operations; and
  • arbitrary Web services, in which the service may expose an arbitrary set of operations.[2]







A web API is a development in web services where emphasis has been moving to simpler representational state transfer (REST) based communications.[3] RESTful APIs do not require XML-based web service protocols (SOAP and WSDL) to support their light-weight interfaces.










No comments:

Post a Comment