Computer networks

41
UNIT 1 OVERVIEW

Transcript of Computer networks

UNIT 1

OVERVIEW

Define computer networks.

• Computer Network is a system which allows communication among different computers connected together.

• It is used for resource sharing, to save money, to provide reliability, provides a powerful communication medium.

• A system with one control unit (master computer) and many slaves is not called a computer network, it is called distributed system.• Types of transmission technology

• Broadcast networks : In broadcast networks all machines on the network use or share single communication channel

• Point-to-point networks : In point to point networks there exits many connections between individual pairs of machines.

Network Categories

What are protocol Hierarchies ?

• Protocol hierarchies are series of layers which reduces the design complexity.

• The number of layers, the name of each layer, the contents of each layer and functions of each layer differ from network to network.

• In network architecture various tasks and functions are grouped into related and manageable sets called LAYERS.

• The problem with the layered protocol is that we lose touch with the reality.

• Layering is a kind of hiding information.

• Layered architecture can sometimes result in poor performance.

What are various design issues for the Layers ?

• Some of the design issues are:

• Addressing• Direction of Transmission :

simple, half or full duplex.• Error control• Avoid loss of sequencing• Ability to receive long

messages.• To use multiplexing and

demultiplexing.

Explain OSI model.

• OSI and TCP/IP are reference models.

• An OSI model is a layered framework for the design of network systems that allows communication across all types of computer systems.

• Layer n on one machine will communicate with layer n on another machine with layer n protocol.

What is the difference between OSI and TCP/IP model ?

OSI Model TCP/IP

Has 7 layers Has 4 layers

Transport layer guarantees delivery of packets.

Transport layer does not guarantee delivery of packets.

Separate presentation & session layer. No presentation and session layer.

Network layer provides both connectionless and connection oriented services.

Network layer provides only connectionless services.

• In both the models the functions of the layer is approximately same.

• Both models use the concept of layered architecture.

What is an application layer ?

• The application layer is the topmost layer of the internet model. This is the layer where all the interesting applications are found.

• People can use the Internet due to presence of application layer.

• The application layer receives the service from the transport layer.

• For the real applications in the application layer to function, there is a need for support protocols

• The three areas or protocols required for such support are:

1. Network security2. Domain Name Service(DNS)3. Network management

• Security is not a single protocol but it contains a large number of concepts and protocols used for providing privacy.

• DNS is used to handle naming or addressing within the Internet.

• The third support protocol is network management.

What is Domain Name System (DNS) ?

• For communication to take place, the sender and receiver both should have addresses and they should know each other.

• It is important to note that there is an alias name for address of remote host. The application program uses an alias name instead of an IP address.

• So the alias address has to be mapped to the IP address. For this application program needs service of another entity.

• This entity is an application program called DNS.

• Note that DNS is not used directly by the user.Resolving NS

Root serverTop-level DNSAuthoritative NS

What is an Electronic Mail (E-mail) ?

• One of the most popular network service is electronic mail (e-mail).

• SMTP is the standard mechanism for electronic mail in the internet.

• The first e-mail systems simply consisted of file transfer protocol.

• But there were limitations:1. It is difficult to send a message to

group of people.2. Message did not have any internal

structure. So its computer processing was difficult.

3. It was not possible to create and send messages containing an image, drawing or voice.

FUNCTIONS 1. Composition 2. Transfer 3. Reporting 4. Displaying 5. Disposition

Why do we use MIME ?

• MIME adds structure to the message body and defines encoding rules for non-ASCII message.

No Header Name Meaning

1 MIMI-Version Indicates the MIME-Version

2 Content-Desc Tells what is in the message

3 Content ID Identifier

4 Content-TransferEncoding

How the body is wrapped for transmission

5 Content-Type Type of message

NEW HEADER IN MIME

Why do we use POP 3 and IMAP protocol?

• The SMTP is used in the first & second stages of mail delivery. But SMTP is not used in the third stage because SMTP is a push protocol which is meant for pushing the message from client to server.

• The third stage needs a pull protocol because client has to pull the message from the server.

• Two message access agents available are: POP 3 & IMAP 4

• MODES OF POP 31. Delete mode : In this mode the

mail is deleted from the mailbox after each retrieval.

2. Keep mode : The mail remains in the mailbox after retrieval.

• Disadvantages : POP 3 does not allow organization of emails on server.

• The user can not create different folders on the server. It can create them only on his own computer.

• The user can not partially check contents of Email before downloading.

• Internet Mail Access Protocol Version 4 is another mail access protocol which is very similar to POP 3 but has more features.

• This makes IMAP 4 more powerful and more complex as compared to POP 3

• Extra features of IMAP 4• It is possible for user to

check header before downloading.

• It is possible to partially download E-mail.

• It is possible to create, rename or delete mailboxes on the mail server.

What is FTP (File Transfer Protocol)?

• A standard mechanism provided by the internet which helps in copying a file from one host to other is known as the File Transfer Protocol.

• Problems 1. Two systems may use

different file name conventions.

2. Two systems may represent text & data in different ways.

3. The directory structures of the two system may be different.

FTP provides solution

What is the difference between FTP and TFTP ?

Sr. No Parameter FTP TFTP

1 Operation Transferring files Transferring files

2 Authentication Yes No

3 Control & data Separated Not Separated

4 Protocol TCP UDP

5 Ports 21-control 20-data Port 3214,69,4012

6 Data transfer Reliable Unreliable

Explain WWW

• www is an architectural framework for accessing documents which are spread over a number of machines over Internet.

• Web and Internet are not the same things. The web is a collection of standard protocols or instructions which are sent back and forth over the internet to gain access to internet.

• Internet on the other hand, is a network of networks –Physical Quantity.

• Web from user side :• Pages, links or pointers• Hypertext• Browser• Hyperlinks• Hypermedia

• Web from the server side :• Every website has a server process.

It is listening to port 80 on which incoming clients are connected

• The protocol used for defining the legal request is called HTTP

Explain HTTP Protocol.

• The principle of HTTP is very simple. A client sends a request. The server sends a response. The request and response message carries data in the form of a letter with a MIME like format.

• HTTP is an application layer protocol.• It is implemented in two programs Client

program & Server program.• HTTP is using TCP as its underlying protocol.• TCP provides a reliable data transfer service to

HTTP. That means each HTTP request message, transmitted by a client will eventually arrive at the server.

What is telnet?

• Telnet is an old terminal emulation program to login into remote system. It uses TCP/IP protocol and underlying communication can take place through PSTN, Satellites etc.

• Telnet allows to login in the system for any operation whereas FTP is used only for file transfer.

• It can be used for Telneting, checking emails and other online services.

• Telnet is a network protocol used on the Internet or local area networks to provide bidirectional interactive text-oriented communication facility using a virtual terminal connection.

• Historically, Telnet provided access to command-line interface on a remote host.

• Telnet was developed in 1968 beginning with RFC 15 extended in RFC 854.

• Telnet is not encrypted.• Hence now we use SSH.

What is DHCP ?

• DHCP is a protocol that is used for communication here network administrators manage and automate assign of Internet Protocol (IP) addresses in an organizational network centrally.

• If we cannot use DHCP, then it is compulsory to enter the IP address to each computer and a new IP.

Runs over UDP Port 67 –Connection to Server

Port 68 –Connection to Client

DHCP server can be installed on Router or it can be a

dedicated machine.

UNIT II OVERVIEW

What is transport layer?

Transport layer is the core of the internet model. It provides service to the application layer and takes service from network layer.

Application layer

Transport layer

Network layer

Transport layer provides service to application layer.

Transport layer takes service from network layer.

What are the functionalities of transport layer?

1. Packetizing2. Connection control3. Addressing4. Flow & Error control5. Congestion control &6. Quality of Service

• The data link layer provides node to node delivery.• The network layer carries out datagram delivery

between two hosts(host to host delivery).• The transport layer takes care of the process-to-

process delivery. Packet from one process is delivered to the other process.

Explain Addressing in transport layer.

• Addressing requirements at different layer are different.

• At data link layer we need MAC address.

• At transport layer we need port number.

• In the Internet model, the port numbers are 16 bit integers.

• Hence total port numbers will be 2^16 = 65,535• The client program identifies itself with a port

number which is chosen randomly.• The server process uses well known port

numbers which are not chosen randomly.

1. Well known ports 0-10232. Registered ports 1024-49,1513. Dynamic ports 49,152-65,535

Then what is socket address?

The combination of IP address and port number is known as socket address.

192.16.100.0 74

IP Port

• Process to process delivery (transport layer communication) has to use two addresses, one is IP and other port number at each end to make a connection.

• These four pieces go to the IP header and transport layer protocol header.

• The IP header contains the IP address and TCP and UDP header contains the port number.

Explain Differences between connection oriented and connectionlessservice.

• Connection oriented : It establishes a dedicated connection between the users before data is exchanged.

• Connection establishment may take place on physical or logical level and needs some kind of signalling.

• TCP • Connectionless : Information is transferred as independent data units.

• Each data units contains complete destination address.

• The packets are not numbered • They get delayed, lost or can

arrive at sequence .• UDP is a connectionless

protocol.

Why error control at both transport layer and data link layer?

We need reliability at transport layer event though data link layer is reliable because data link can provide reliability for only the node to node delivery.• If the application layer program needs

reliability then the reliable transport layer protocol is used which implements the flow and error control mechanism .

• But some application layer program do not need reliability because they have their own error and flow control mechanism. Such programs use an unreliable service.

How to establish a connection?

A B

Connection Request A to B

Acknowledgement

Connection Request B to A

Acknowledgement

• Problems : Due to congestion on a subnet, the acknowledgement do not get back in time or take longer time.

• The same connection getting re-established due to duplication of packets.

• Solution : We should ensure that no packet lives longer than some predicted time.

• Like time stamping or putting hop counter in each packet.

How to solve duplicate packet problem using three way handshake?

A B

CR

ACK

Data

A BDuplicate

ACK

Rejects

CR

• The first TPDU is a delayed duplicate connection request from an old connection. The host A does not about it.

• Host B receives TPDU and sends to host A

• But host A is not trying to establish any connection, so it sends a reject along with ACK

Explain UDP in short.

• Simple unreliable and connectionless protocol.

• A unit of data sent using UDP is called datagram.

• UDP adds four 16 bit header to all the data sent i.e a length field, checksum, source and destination port numbers.

• Although UDP is not reliable, it is still a preferred choice for many applications like audio and video where if data is lost, it is better to send it again.

• It is also by protocols like Simple Network Management Protocol

• UDP is used in RIP and multicasting application

Header Data

8 bytes

Source port number 16 bits

Destination port number 16 bits

Total length 16 bits

Checksum16 bits

Explain TCP in short.

• TCP is a connection-oriented protocol and provides reliable transmission.

• Reliability, efficient flow control, full duplex operation.

• TCP provides multiplexing means that numerous simultaneous upper-layer conversation can be multiplexed over a single connection.

• TCP message gets encapsulated or inserted in IP datagram and sent to destination.

• At the destination IP hands over the message to TCP software running on the destination computer.

• Thus TCP deals with the actual data to be transferred and IP takes care of transfer of that data

Source Port Destination Port

Sequence number

Acknowledgement number

TCP header length

Reserved FlagsWind

ow

Checksum Urgent Pointer

Options(0-32 bit) Padding

DATA

TCP header

Optional Portion

What is TCP sliding window policy?

Empty

Receiver Buffer

0 4K

2K

Full

2K

1K 2K

Application reads 2k

Application does a 2k write

Application does a 2k write

Sender is blocked

Sender may send up to 2k

Sender Receiver

Explain Congestion in Short.

• If extremely large number of packets are present in a part of a subnet, the performance degrades.

• Congestion may occur due to overloading of network.

• At high traffic, the performance collapses completely and almost all packets are lost. This is the worst possible congestion.

• CausesSource 1

Source 2

Source 3

Router

Slow Processors

Congestion Control :

Open loop solution having excellent design to prevent congestion from happening, based on current status of the network.

Closed loop solution1.Detect the congestion and locate it.2.Transfer the information about the congestion to place where action can be taken.3. Adjust the system operations to correct the congestion.

Explain Socket

• A socket acts as an end point.• Two processes communicate

through socket if they have socket at their ends.

• STREAM SOCKET, DATAGRAM SOCKET, RAW SOCKET

Family Type Protocol

Local Socket Address

Remote Socket Structure

Socket Structure

• Family : This field is used for defining the protocol group such as IPv4 or IPv6

• Type : This field is used for defining the type of socket such as stream socket, datagram socket or raw socket.

• Protocol : This field is usually zero for TCP and UDP• Local Socket Address : It is used for defining the local

socket address which is a combination of IP address and port address of the local application program.

• Remote Socket Address : It is used for defining the remote socket address which is a combination of IP address and port address of the remote application program.

SERVER SIDE :• Server creates a socket and checks

for error using SOCKET.• Assign address to newly created

socket using BIND• Use LISTEN to allocate space for

queue which is used for incoming calls.

• Execute an ACCEPT for blocking the waiting incoming connections.

CLIENT SIDE :• Create a socket using SOCKET• Use CONNECT to initiate

connection process.• Establish the connection.

SOCKET

Why do we use Real-time Transport protocol (RTP)?

• Real-time protocol is concerned with timing information.

• TCP is quite unsuitable for real-time traffic.

• TCP is a point to point protocol without direct support for multicast.

• There is no timing information carried, which is needed by most real-time applications.

• Hence IETF adopted RTP

• Assuming transport protocol as a RTP is bit confusing because it is typically used with UDP that can say as a connection less transport protocol.

• Real-time transport protocol is very closely coupled to the application it carries. So, RTP is best viewed as a framework that applications can use to implement a new single-protocol.

• RTP does not guarantee timely release of packets, nor does it maintain the packets in order.

• RTP provide the responsibility for improving lost segment and re-sequencing of packets for application layer.

What is Stream Control Transmission Protocol (SCTP) ?

• SCTP is referred to as next generation TCP to hold a telephone connection over the internet.

• SCTP is standard protocol define RFC 2960 and invented by IETF

• Like TCP, SCTP handle reliable transport

• Contrasting to TCP, SCTP guarantee the complete simultaneous transmission of several streams of data between connected terminals.

• SCTP’s multi-streaming allows data to be delivered in independent streams, so if there is loss of data in one stream, delivery will not be affected for other streams.

• Acknowledged error free non-duplicated transfer of user data.

• Sequenced delivery of user message within multiple streams.

• Network level fault tolerance through supporting of multi-homing at either or both ends of an association.

How to achieve good QoS?

• Buffering• Traffic shaping• Leaky bucket algorithm• Token bucket algorithm• Resource reservation• Admission control• Proportional routing• Packet scheduling

Fixed size packet Variable size packet

Fixed number of packets

Fixed number of bits

What is Token Bucket Algorithm?

• Token bucket algorithm is a variant of leaky bucket algorithm, here the buckets are filled with tokens.

• A packet which grabs the token is allowed to leave the bucket due to which packets never get lost.

• Token bucket can be easily implemented with a counter. The counter is initialised to zero.

• Every time a token is added counter is incremented by 1 and every time a packet is dispatched, the counter is decremented by 1.

Explain Scheduling and Policing :

• The good QoS can be ensured by following some mechanism like Scheduling and Policing.

• FIFO, Priority Queueing, Round Robin and Weighted Fair Queueing (WFQ)

• In order to regulate this flow certain rate aspects should be policed

• Following are the important policing criteria Average rate, Peak rate, Burst size

What are Integrated & Differentiated services?

• These are the two architectures Intserv is defined as a framework which is developed within IEFT for providing QoS guarantees to invidualapplication sessions.

• The goal of Diffserv is to provide the ability to handle different classes of traffic in different ways within the internet.

• Intserv architecture has two key features: 1. Reserved resources and 2. Call set up

• Reserved resources : a router must know about how much of its resources such as buffer, link bandwidth have already reserved for the current ongoing session.

• The call setup is also called as call admission. Each router has to determine the local resources required by the session and also it should find amount of resources already occupied.

• Problems: 1. Scalability-Per flow reservation can increase the overhead in large networks to a great extent.

• 2 Intserv framework provides for a small number of pre specified service classes. Class A service is preferred over Class B service and so on.

• The diffserv architecture consists of two sets of functional elements

• Edge functions• Core functions

• Edge functions :packet classification and traffic conditioning• For example in figure packets which are sent from H1 to H3

travel through the routers R1,R3,R5 and R7 may be marked as R1

• Such type of mark received by a packet will identify the class of traffic which it belongs. Different classes of service will then receive different service within the core network.

• Core functions: Forwarding• The DS marked packet arrives at the DS capable router. The

router understands the class of received packet.• The per hop behaviour of the router is associated with the

packet class. The router will forward the packet onto their hop according to the per hop behaviour.

• The per hop behaviour is important because it decides how a router’s buffer and link bandwidth are shared among various service class.

What is RSVP ?

• Resource ReserVation Protocol is a signalling protocol which allows running in the host computer to reserve resource in the Internet.

• The resource in the Internet are : link bandwidth and router buffer.

• To implement RSVP, the RSVP software has to be present in the receivers, senders and routers.

• The transmitting source advertises its contents by sending the RSVP path message through the multicast tree.

• These messages indicate the bandwidth required for the contents, time out interval, upstream path to the sender etc.

• Each receiver sends an RSVP reservation message upstream to the sender.

• When the reservation message reaches a router, it will adjust its packet scheduler for accommodating the reservation. It then sends the reservation upstream.