Professional Documents
Culture Documents
Chapter 5
Chapter 5
20 FTP data
Functions: 21 FTP control
22 SSH (Secure Shell Connection)
Error handling
23 Telnet
Flow control 25 SMTP (Simple Mail Transfer Protocol)
Multiplexing 53 DNS
Connection set-up and release 80 HTTP (web server)
Congestion handling 110 POP 3 (Post Office Protocol)
Segmentation and reassembly 143 IMAP (Interactive Message Access Protocol)
Addressing (port addressing)
Well-known ports (0-1023): assigned and controlled by IANA
Services: Registered ports (1024-49151): not assigned and controlled by
Reliable, in-order unicast delivery (TCP) IANA but only registered to prevent from duplication
Unreliable, unordered unicast or multicast delivery (UDP) Dynamic ports (49152-65535): can be used in any process
TCP (Transmission Control Protocol): Socket=IP:Port number (for various hosts, port num. may be same but
This is a real protocol which runs in transport layer. socket number will be different)
It offers reliable connection oriented service between source and Source port # (16) Dest. Port # (16)
destination. Sequence number (32)
It acts as if it is connecting two end points together, so that it is a point Acknowledgement number (32)
to point connection between two parties. Hlen(4) Res. U A P R S F Window size (16)
It doesn’t support multicasting (because it is connection oriented). (6)
The data in TCP is called a segment. Checksum (16) Urgent ptr. (16)
Options (32)
Segments are obtained after breaking big files into small pieces.
Data
It assists in flow control.
It provides buffer to each connection.
When too many packets are present in a subnet or a part of subnet, 1. Traffic shaping:
performance degrades. This situation is called congestion. When number Also called as ‘Service Level Management’.
of packets dumped into the subnet by the hosts is within its carrying The abrupt traffic is decreased without affecting the performance of
capacity, they are all delivered (except for a few that contain transmission application layer.
errors), and the number delivered is proportional to the number sent. Traffic will be shaped as per the negotiation between source and
However as traffic increases too far, the routers are no longer able to destination.
cope, and they begin losing packets. At very high traffics, performance Sliding window protocol at some level helps in traffic shaping.
collapses completely, and almost no packets are delivered. Example: a flow that specifies an average throughput of 1 Mbps of
traffic for a millisecond followed by no traffic for a millisecond. A
Causes of Congestion:
router can reshape the burst by temporarily queuing incoming
When there are more output lines and less or single output lines. datagrams and sending them at a steady rate of 1 Mbps.
When there is slow router i.e. if routers’ CPUs are slow.
2. Leaky Bucket Algorithm: if bucket is full. To minimize such limitation of bucket, token bucket
Imagine a bucket with a small hole in the bottom. No matter at what rate algorithm was introduced.
water enters the bucket, the outflow is at constant rate, when there is The bucket holds token, not packet. Tokens are generated by clock at
any water in the bucket and zero when the bucket is empty. Also, once the rate of one token per ΔT sec. For a packet to be transmitted, it
the bucket is full, any additional water entering it spills over the sides and must capture and destroy one token. The token bucket algorithm
is lost. allows saving up permission to send large burst later, up to the
The same idea can be applied to the packets. Conceptually, each host maximum size of the bucket, as leaky bucket doesn’t allow. This
connected to the network by an interface, containing a leaky bucket, i.e. property means that bursts of packets can be sent at once allowing
finite internal queue. If a packet arrives at the queue when it is full, the some burstiness at output stream and giving faster response to
packet is discarded. If one or more processes within the host try to send a sudden bursts of input.
packet when a maximum number are already in queue, the new packet is Another difference between token bucket and leaky bucket is that the
discarded. token bucket throws away token when the bucket fills up but never
discards packets. In token bucket also allows sending bytes basis, for
variable size packets. A packet can only be transmitted, if enough
token are available to cover its length in bytes. Fractional tokens are
kept for future use.
The implementation of basic token bucket algorithm is just a variable
counts tokens. The counter is incremented by one at every ΔT sec and
decremented by one whenever one packet is sent. When counter hits
zero, no packet can be sent.
client server
open
listen client server
close
established
established close
closed
closed d
d