0% found this document useful (0 votes)
107 views

Computer Networking AKTU Notes

Uploaded by

Akshit Gulyan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views

Computer Networking AKTU Notes

Uploaded by

Akshit Gulyan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Transport Layer: Process-to-process delivery, Transport layer protocols (UDP and

TCP), Multiplexing, Connection management, Flow control and retransmission, Window


management, TCP Congestion control, Quality of service.

Services of Transport Layer


● Segmentation and Reassembly
● Process to process delivery
● Use port addressing.
● TCP
● UDP
● Multiplexing and Demultiplexing

lANA Ranges
•The lANA (Internet Assigned Number Authority) has divided the port numbers into three
ranges: well known, registered, and dynamic (or private).
● Well-known ports: The ports ranging from 0 to 1023 are assigned and controlled by
lANA. These are the well-known ports

● Registered ports: The ports ranging from 1024 to 49,151 are not assigned or
controlled by lANA. They can only be registered with lANA to prevent
duplication.

● Dynamic ports: The ports ranging from 49,152 to 65,535 are neither controlled nor
registered. They can be used by any process. These are the ephemeral ports.
Suyasha Jain

Socket Addresses
The combination of an IP address and a port number is called a socket address.

Ques : If the data link layer is reliable and has flow and error control, do we need this at
the transport layer, too?
The answer is yes.
● Reliability at the data link layer is between two nodes; we need reliability between
two ends.
● Because the network layer in the Internet is unreliable (best-effort delivery), we
need to implement reliability at the transport layer.

USER DATAGRAM PROTOCOL (UDP)


Suyasha Jain

UDP Operations
•Connectionless Services: There is no connection establishment and no connection
termination, as is the case for TCP. This means that each user datagram can travel on a
different path.each request must be small enough to fit into one user datagram. Only those
processes sending short messages should use UDP.
•No Flow and Error Control: UDP is a very simple, unreliable transport protocol. There
is no flow control and hence no window mechanism. The receiver may overflow with
incoming messages. There is no error control mechanism in UDP except for the
checksum.
•Encapsulation and Decapsulation:
Queuing:
● At the client site, when a process starts, it requests a port number from the operating
system.
● The client process can send messages to the outgoing queue by using the source port
number specified in the request.
● UDP removes the messages one by one and, after adding the UDP header, delivers
them to IP.
● When a message arrives for a client, UDP checks to see if an incoming queue has
been created for the port number specified in the destination port number field of
the user datagram.
● When a message arrives for a server, UDP checks to see if an incoming queue has
been created for the port number specified in the destination port number field of
the user datagram.

Suyasha Jain

● When a server wants to respond to a client, it sends messages to the outgoing queue,
using the source port number specified in the request
Uses of UDP
•UDP is suitable for a process that requires simple request-response communication with
little concern for flow and error control. It is not usually used for a process such as FTP
that needs to send bulk data.
•UDP is suitable for a process with internal flow and error control mechanisms.
•UDP is a suitable transport protocol for multicasting. Multicasting capability is
embedded in the UDP software but not in the TCP software.
•UDP is used for management processes such as SNMP (Simple Network Management
Protocol).
•UDP is used for some route updating protocols such as Routing Information Protocol.

TCP Services
•Process-to-Process Communication (TCP provides process-to-process communication
using port number)

•Stream Delivery Service: TCP, allows the sending process to deliver data as a stream of
bytes and allows the receiving process to obtain data as a stream of bytes. TCP creates an
environment in which the two processes seem to be connected by an imaginary "tube" that
carries their data across the Internet

Suyasha Jain
At the sending site, the buffer has three types of chambers. The white section contains
empty chambers that can be filled by the sending process (producer). The gray area holds
bytes that have been sent but not yet acknowledged. TCP keeps these bytes in the buffer
until it receives an acknowledgment. The colored area contains bytes to be sent by the
sending.
At the receiving site, the circular buffer is divided into two areas (shown as white and
colored). The white area contains empty chambers to be filled by bytes received from the
network. The colored sections contain received bytes that can be read by the receiving
process.

Full-Duplex Communication

•TCP offers full-duplex service, in which data can flow in both directions at the same
time. •Each TCP then has a sending and receiving buffer, and segments move in both
directions. Connection-Oriented Service
TCP, unlike UDP, is a connection-oriented protocol. When a process at site A wants to
send and receive data from another process at site B, the following occurs:
● The two TCPs establish a connection between them.
● Data are exchanged in both directions.
● The connection is terminated.
Note that this is a virtual connection, not a physical connection.

Suyasha Jain
Reliable Service: TCP is a reliable transport protocol. It uses an acknowledgment
mechanism to check the safe and sound arrival of data

TCP Features
Numbering System
There are two fields called the sequence number and the acknowledgment number. These
two fields refer to the byte number and not the segment number.
Byte Number
The bytes of data being transferred in each connection are numbered by TCP. The
numbering starts with a randomly generated number.
Acknowledgment Number
The value of the acknowledgment field in a segment defines the number of the next byte a
party expects to receive.
Sequence Number
After the bytes have been numbered, TCP assigns a sequence number to each segment that
is being sent.

TCP segment format


Suyasha Jain

Source port address: This is a 16-bit field that defines the port number of the the host
that is sending the segment.
Destination port address: This is a 16-bit field that defines the port number of the the
host that is receiving the segment.
Sequence number: This 32-bit field defines the number assigned to the first byte of data
contained in this segment.
Acknowledgment number: This 32-bit field defines the byte number that the receiver of
the segment is expecting to receive from the other party
Header length: This 4-bit field indicates the number of 4-byte words in the TCP header.
The length of the header can be between 20 and 60 bytes. Therefore, the value of this field
can be between 5 (5 x 4 =20) and 15 (15 x 4 =60).
Reserved: This is a 6-bit field reserved for future use.
Control: This field defines 6 different control bits or flags
Window size: This field defines the size of the window, in bytes, that the other party must
maintain. Note that the length of this field is 16 bits, which means that the maximum size
of the window is 65,535 bytes.
Checksum: This 16-bit field contains the checksum.
Urgent pointer: This l6-bit field, which is valid only if the urgent flag is set, is used when
the segment contains urgent data.
Options: There can be up to 40 bytes of optional information

Suyasha Jain
Suyasha Jain
A TCP Connection
Connection Establishment- Three-Way Handshaking (Full duplex mode)

Data Transfer
● Piggybacking - Data and acknowledgement send at same time, this reduces network
traffic
● Pure acknowledgement: If you don't have data to send & time out then send only
acknowledgement.

Suyasha Jain
Connection Termination- when all data is send at client side

Half-Close: client to server connection is over, Data can’t be send from client to server,
ack can be send

Flow Control in TCP

•TCP, unlike UDP, provides flow control.


•The receiver of the data controls the amount of data that is to be sent by the sender.
•This is done to prevent the receiver from being overwhelmed with data. The numbering
system allows TCP to use a byte-oriented flow control.

Suyasha Jain
Error Control
•To provide reliable service, TCP implements an error control mechanism.
•Error detection and correction in TCP is achieved through the use :
•checksum
•acknowledgment
•time-out.

Congestion Control
● TCP, unlike UDP, takes into account congestion in the network.
● The amount of data sent by a sender is not only controlled by the receiver (flow
control), but is also determined by the level of congestion in the network.

Congestion Policy
1) Slow Start: Exponential Increase
The size of the window increases one MSS each time an acknowledgment is received. As
the name implies, the window starts slowly, but grows exponentially.
Suyasha Jain

2) Congestion Avoidance: Additive Increase


When the size of the congestion window reaches the slow-start threshold, the slow-start
phase stops and the additive phase begins. In this algorithm, each time the whole window
of segments is acknowledged (one round), the size of the congestion window is increased
by 1.
3) Congestion Detection: Multiplicative Decrease
If congestion occurs, the congestion window size must be decreased.

An implementation reacts to congestion detection in one of the following ways:


o If detection is by time-out, a new slow-start phase starts.
o If detection is by three ACKs, a new congestion avoidance phase starts

Suyasha Jain

QUALITY OF SERVICE
Quality of service (QoS) is the use of mechanisms or technologies that work on a network
to control traffic and ensure the performance of critical applications with limited network
capacity.
TECHNIQUES TO IMPROVE QoS
● Scheduling
● Traffic Shaping
● Resource Reservation
● Admission Control

1) Scheduling
Packets from different flows arrive at a switch or router for processing. A good scheduling
technique treats the different flows in a fair and appropriate manner.
● FIFO Queuing

● Priority Queuing

Suyasha Jain

● Weighted Fair Queuing


2)Traffic Shaping
Traffic shaping is a mechanism to control the amount and the rate of the traffic sent to the
network.

Leaky Bucket
● The input rate can vary, but the output rate remains constant.
● The leaky bucket smooths the traffic by sending out data at a uniform rate. Without
the leaky bucket, the beginning burst may have hurt the network by consuming
more bandwidth than is set aside for this host. We can also see that the leaky
bucket may prevent congestion.

Suyasha Jain
Token Bucket
The token bucket algorithm allows idle hosts to accumulate credit for the future in the
form of tokens. For each tick of the clock, the system sends n tokens to the bucket. The
system removes one token for every cell (or byte) of data sent.

3)Resource Reservation
● A flow of data needs resources such as a buffer, bandwidth, CPU time, and so on.
● The quality of service is improved if these resources are reserved beforehand.

4)Admission Control
● Admission control refers to the mechanism used by a router, or a switch, to accept
or reject a flow based on predefined parameters called flow specifications.
● a router accepts a flow for processing, it checks the flow specifications to see if its
capacity (in terms of bandwidth, buffer size, CPU speed, etc.) and its previous
commitments to other flows can handle the new flow

Suyasha Jain
PYQ
1) The following is the dump of a TCP header in hexa-decimal format: 10M 2018-2019
05320017 00000001 00000000 500207FF 00000000
(i) What is the sequence number?
(ii) What is the destination port number?
(iii) What is the acknowledgement number?
(iv) What is the window size?
Suyasha Jain

OR
What do you understand about Quality-of-service parameters? List various Quality of
service parameters.
2) Explain about the TCP header and working of TCP protocol and differentiate between
TCP and UDP with frame format. 10M 2018-19
3) What is the difference between network layer delivery and transport layer delivery? 2M
2018-19
4) Write a detailed note on “TCP vs UDP”. 10M 2021-22
5) List out the prime three functions of the transport layer. 2M 2021-22
6) Explain the use of the RST flag in the TCP header. 2M 2021-22

Suyasha Jain
Suyasha Jain

You might also like