0% found this document useful (0 votes)
66 views6 pages

Sem 5 Network

The document discusses the TCP/IP protocol architecture. It describes the four layers of the TCP/IP model: application layer, transport layer, internet layer, and physical layer. It provides details on some of the key protocols that operate at each layer, such as HTTP, TCP, IP, and Ethernet. The document also discusses the roles and responsibilities of each layer in managing communication across the network.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views6 pages

Sem 5 Network

The document discusses the TCP/IP protocol architecture. It describes the four layers of the TCP/IP model: application layer, transport layer, internet layer, and physical layer. It provides details on some of the key protocols that operate at each layer, such as HTTP, TCP, IP, and Ethernet. The document also discusses the roles and responsibilities of each layer in managing communication across the network.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Q. With neat diagram explain the architecture of TCP/IP.

Answer:: TCP/IP (Transmission Control Protocol / Internet Protocol) Different features of TCP/IP

• TCP/IP is independent of the network hardware.

• TCP/IP can recover failure; it is able to divert data immediately through other routers if one or more
parts of network failed.

• TCP/IP provides the facility to connect new subnetworks without significant interference of services.

• TCP/IP is reliable to handling high error rate with facilities for full error control.

• TCP/IP is also reliable of transmission of files, remote login, and remote execution of commands.

Every host in a network has two addresses: a hardwired MAC address and a logical IP address. TCP/IP
uses both these addresses. MAC

TCP/IP model layers

TCP/IP functionality is divided into four layers, each of which include specific protocols.

 The application layer provides applications with standardized data exchange. Its
protocols include the Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP),
Post Office Protocol 3 (POP3), Simple Mail Transfer Protocol (SMTP) and Simple
Network Management Protocol (SNMP).
 The transport layer is responsible for maintaining end-to-end communications across the
network. TCP handles communications between hosts and provides flow control,
multiplexing and reliability. The transport protocols include TCP and User Datagram
Protocol (UDP), which is sometimes used instead of TCP for special purposes.
 The network layer, also called the internet layer, deals with packets and connects
independent networks to transport the packets across network boundaries. The network
layer protocols are the IP and the Internet Control Message Protocol (ICMP), which is
used for error reporting.
 The physical layer consists of protocols that operate only on a link -- the network
component that interconnects nodes or hosts in the network. The protocols in this layer
include Ethernet for local area networks (LANs) and the Address Resolution Protocol
(ARP).

Q. Discuss in detail about the Path control layer of SNA.

Answer:: Systems Network Architecture (SNA) provides for communication


between a diverse group of IBM products. SNA is a hierarchical
structure that consists of seven well-defined layers. Each layer in the
architecture performs a specific function.

The 7 layers of SNA are:

END USER
|
TRANSACTION SERVICES provides application services such as
distributed data base access and document interchange.
|
PRESENTATION SERVICES formats data for different presentation
media and coordinates the sharing of resources.
|
DATA FLOW CONTROL synchronizes data flow, correlates exchanges
of data, and groups related data into units.
|
TRANSMISSION CONTROL paces data exchanges to match processing
capacity and enciphers data if security is needed.
|
PATH CONTROL routes data between source and destination and
controls data traffic in the network.
|
DATA LINK CONTROL transmits data between adjacent nodes.
|
PHYSICAL CONTROL connects adjacent nodes physically and electri-
cally. Lowest level.

----------------------------------------------------------------------------
Each layer performs services for the next higher layer, requests services
from the next lower layer, and communicates with corresponding layers in
other SNSA-based products.
For example, the PHYSICAL CONTROL Layer:
- Manages the physical interface between its node and the transmission
facilities that are attached to the node
- Performs services for the data link control layer
- Communicates with physical control layers in other SNA-based products

Another example, the TRANSACTION SERVICES Layer:


- Provides the end user access to the network
- Requests services from the presentation services layer
- Communicates with transaction layers in other SNA-based products

Network Components:
Hardware and software components implement the functions of the seven
architectural layers.
Hardware components include processors, communications controllers,
cluster controllers, workstations, and printers.
Software components that implement SNA functions include telecommunication
access methods, application subsystems, and network control programs.

Q. Discuss about Elementary socket system calls in detail.

Answer:: elementary socket system calls

socket

To do network I/O, the first thing a process must do is to call the socket system call, specifying
the type of communication protocol desired.
#include <sys/types.h>
#include <sys/socket.h>

int socket(int family, int type, int protocol);


The family is one of
AF_UNIX -- Unix internal protocols
AF_INET -- Internet protocols
AF_NS -- Xerox NS Protocols
AF_IMPLINK -- IMP link layer
The AF_ prefix stands for "address family." In the first project, we are going to use AF_INET.

The socket type is one of the following:


SOCK_STREAM stream socket
SOCK_DGRAM datagram socket
SOCK_RAW raw socket
SOCK_SEQPACKET sequenced packet socket
SOCK_RDM reliably delivered message socket (not implemented yet)
The protocol argument to the socket system call is typically set to 0 for most user applications.
The valid combinations are shown as follows.
family type protocol Actual protocol
AF_INET SOCK_DGRAM IPPROTO_UDP UDP
AF_INET SOCK_STREAM IPPROTO_TCP TCP
AF_INET SOCK_RAW IPPROTO_ICMP ICMP
AF_INET SOCK_RAW IPPROTO_RAW (raw)

bind

The bind system call assigns a name to an unnamed socket.


#include <sys/types.h>
#include <sys/socket.h>

int bind(int sockfd, struct sockaddr *myaddr, int addrlen);


The first argument is the socket descriptor returned from socket system call. The second
argument is a pointer to a protocol-specific address and the third argument is the size of this
address. There are three uses of bind. 

1. Servers register their well-known address with the system. It tells the system "this is my
address and any messages received for this address are to be given to me." Both
connection-oriented and connectionless servers need to do this before accepting client
requests.
2. A client can register a specific address for itself.
3. A connectionless client needs to assure that the system assigns it some unique address, so
that the other end (the server) has a valid return address to send its responses to. This
corresponds to making certain an envelope has a valid return address, if we expect to get
a reply from the person we sent the letter to.

connect

A client process connects a socket descriptor following the socket system call to establish a


connection with a server.
#include <sys/types.h>
#include <sys/socket.h>

int connect(int sockfd, struct sockaddr *servaddr, int addrlen);


The sockfd is a socket descriptor that was returned by the socket system call. The second and
third arguments are a pointer to a socket address, and its size, as described earlier. 
For most connection-oriented protocols (TCP, for example), the connect system call results in
the actual establishment of a connection between the local system and the foreign system. 
The connect system call does not return until the connection is established, or an error is
returned to the process. 
The client does not have to bind a local address before calling connect. The connection typically
causes these four elements of the association 5-tuple to be assigned: local-addr, local-
process,foreign-addr, and foreign-process. In all the connection-oriented clients, we will
let connect assign the local address. 

listen

This system call is used by a connection-oriented server to indicate that it is willing to receive
connections.
#include <sys/types.h>
#include <sys/socket.h>

int listen(int sockfd, int backlog);


It is usually executed after both the socket and bind system calls, and immediately before
the accept system call. The backlog argument specifies how many connection requests can be
queued by the system while it waits for the server to execute the accept system call. This
argument is usually specified as 5, the maximum value currently allowed. 

accept

After a connection-oriented server executes the listen system call described above, an actual


connection from some client process is waited for by having the server execute
the accept system call.
#include <sys/types.h>
#include <sys/socket.h>

int accept(int sockfd, struct sockaddr *peer, int *addrlen);


accept takes the first connection request on the queue and creates another socket with the same
properties as sockfd. If there are no connection requests pending, this call blocks the caller until
one arrives. 
The peer and addrlen arguments are used to return the address of the connected peer process (the
client). addrlen is called a value-result argument: the caller sets its value before the system call,
and the system call stores a result in the variable. For this system call the caller sets addrlen to
the size of the sockaddr structure whose address is passed as the peer argument. 

send, sendto, recv and recvfrom

These system calls are similar to the standard read and write system calls, but additional
arguments are required.
#include <sys/types.h>
#include <sys/socket.h>

int send(int sockfd, char *buff, int nbytes, int flags);


int sendto(int sockfd, char *buff, int nbytes, int flags, struct sockaddr *to,
int addrlen);
int recv(int sockfd, char *buff, int nbytes, int flags);
int recvfrom(int sockfd, char *buff, int nbytes, int flags, struct sockaddr
*from, int *addrlen);
The first three arguments, sockfd, buff, and nbytes, to the four system calls are similar to the first
three arguments for read and write. The flags argument can be safely set to zero ignoring the
details for it. The to argument for sendto specifies the protocol-specific address of where the
data is to be sent. Since this address is protocol-specific, its length must be specified by addrlen.
Therecvfrom system call fills in the protocol-specific address of who sent the data into from.
The length of this address is also returned to the caller in addrlen. Note that the final argument
to sendtois an integer value, while the final argument to recvfrom is a pointer to an integer
value. 

close

The normal Unix close system call is also used to close a socket.


int close(int fd);
If the socket being closed is associated with a protocol that promises reliable delivery (e.g., TCP
or SPP), the system must assure that any data within the kernel that still has to be transmitted or
acknowledged, is sent. Normally, the system returns from the close immediately, but the kernel
still tries to send any data already queued. 

You might also like