CN 4
CN 4
CN 4
By Prof. P. K. Bachhav
Outline
Services
Addressing
Berkley Sockets,
Multiplexing,
TCP
Connection establishment,
Connection release,
Flow control and buffering,
TCPTimer management,
TCP Congestion Control,
RealTimeTransport protocol(RTP),
Stream ControlTransmission Protocol (SCTP),
Quality of Service (QoS),
Differentiated services,
TCP and UDP forWireless. 8/ 21/ 2017
Introduction
• The transport layer is responsible for process-to-
process delivery.
• It involves the delivery of segments - part of a
message , from one process to another.
• The transport layer uses client-server model for
communication between two processes.
Transport Layer Services
Process to Process delivery
Connection less as well as connection oriented data delivery
Error control
multiplexing/demultiplexing
flow control
congestion control
Process to Process Data Delivery
Outline
Services,
Addressing
Berkley Sockets,
Multiplexing,
TCP
Connection establishment,
Connection release,
Flow control and buffering,
TCPTimer management,
TCP Congestion Control,
RealTimeTransport protocol(RTP),
Stream ControlTransmission Protocol (SCTP),
Quality of Service (QoS),
Differentiated services,
TCP and UDP forWireless. 8/ 21/ 2017
Addressing
• MacAddress (48 bit)
• Physical address
• NIC Card
• From 1024-49151
•
Registered •
Not assigned &controlled by IANA
Can only be registered with IANA
• Ex. MySQL(3306), MongoDB(27017)
• From 49152-65535
Dynamic • Nither controlled nor registered by IANA
• They can be used by any client Program(Process)
Outline
Services,
Addressing
Berkley Sockets,
Multiplexing,
TCP
Connection establishment,
Connection release,
Flow control and buffering,
TCPTimer management,
TCP Congestion Control,
RealTimeTransport protocol(RTP),
Stream ControlTransmission Protocol (SCTP),
Quality of Service (QoS),
Differentiated services,
TCP and UDP forWireless. 8/ 21/ 2017
Socket address
A socket is one endpoint of a two way communication link between two
programs running on the network. ... A socket connecting to the network is
created at each end of the communication. Each socket has a specific
address. This address is composed of an IP address and a port number.
Transport Service Primitives
Berkeley Sockets
Berkeley sockets is an application programming interface (API)
for Internet sockets and Unix domain sockets, used for inter-
process communication
Outline
Services,
Addressing
Berkley Sockets,
Multiplexing,
TCP
Connection establishment,
Connection release,
Flow control and buffering,
TCPTimer management,
TCP Congestion Control,
RealTimeTransport protocol(RTP),
Stream ControlTransmission Protocol (SCTP),
Quality of Service (QoS),
Differentiated services,
TCP and UDP forWireless. 8/ 21/ 2017
Multiplexing and demultiplexing
Multiplexing/demultiplexing
• congestion control
• flow control
• connection setup
6-14, a, b
Connection Release Scenarios…
(c) Response lost. (d) Response lost and subsequent DRs lost.
6-14, c,d
Outline
Services,
Addressing
Berkley Sockets,
Multiplexing,
TCP
Connection establishment,
Connection release,
Flow control and buffering,
TCPTimer management,
TCP Congestion Control,
RealTimeTransport protocol(RTP),
Stream ControlTransmission Protocol (SCTP),
Quality of Service (QoS),
Differentiated services,
TCP and UDP forWireless. 8/ 21/ 2017
TCP Transmission Policy(Flow control)
•Nagle’s solution
•Clark’s solution
Nagle's algorithm
Purpose is to allow the sender TCP to make efficient use of the network, while
still being responsive to the sender applications.
Idea:
If application data comes in byte by byte, send first byte only.Then buffer all
application data till untilACKfor first byte comesin.
If network is slow and application is fast, the second segment will contain a lot of
data.
Send second segment and buffer all data tillACK for second segment comes in.
An exception to this rule is to always send (not wait forACK) if enough data for
half the receiver window or MSS(Maximum segment size) is accumulated.
Clark's algorithm
Purpose is to prevent the receiver from sending a window
update for 1byte.
Idea:
The receiver should not send a window update until it can handle
the maximum segment size it declared when the connection was
established or until its buffer is half empty, whichever is smaller
Outline
Services,
Addressing
Berkley Sockets,
Multiplexing,
TCP
Connection establishment,
Connection release,
Flow control and buffering,
TCPTimer management,
TCP Congestion Control,
RealTimeTransport protocol(RTP),
Stream ControlTransmission Protocol (SCTP),
Quality of Service (QoS),
Differentiated services,
TCP and UDP forWireless. 8/ 21/ 2017
TCP timers- TCP uses 4 timers to do its work
The most important of these is the RTO (RetransmissionTimeOut).When a segment is
sent, a retransmission timer is started. If the segment is acknowledged before the timer
expires, the timer is stopped. If, on the other hand, the timer goes off before the
acknowledgement comes in, the segment is retransmitted (and the timer os started again).
Athird timer that some implementations use is the keepalive timer.When a connection
has been idle for a long time, the keepalive timer may go off to cause one side to check
whether the other side is still there.
The last timer used on eachTCP connection is the one used in theTIMEWAIT state while
closing. It runs for twice the maximum packet lifetime to make sure that when a
connection is closed; all packets created by it have died off.
Outline
Services,
Addressing
Berkley Sockets,
Multiplexing,
TCP
Connection establishment,
Connection release,
Flow control and buffering,
TCPTimer management,
TCPCongestion Control,
RealTimeTransport protocol(RTP),
Stream ControlTransmission Protocol (SCTP),
Quality of Service (QoS),
Differentiated services,
TCP and UDP forWireless. 8/ 21/ 2017
Congestion control policies
TCP congestion control
We looked at how TCP handles flow control. In addition we know the
congestion happens.The only real way to handle congestion is for the
sender to reduce sending rate.
In old days, packets were lost due to transmission errors and congestion.
But nowadays, transmission errors are very rare (except for wireless).
So,TCP assumes a lost packet as an indicator of congestion.
Problem Solution
Receiver capacity Receiver window (rwnd)
Network capacity Congestion window (cwnd)
Queing
Queues in UDP
Uses of UDP
Simple Request reply communication
Suitable for process with internal flow and control mechanisms. Eg.TFTP
Applications
RTP & RTCP
Other transport and UDP
network protocols IP
RTP – packet format
V P X CSRC M Payload Sequence number
count type (16 bits) Fixed
Timestamp (32 bits) header
Synchronization source (SSRC) id. (32 bits)
Contributing source (CSRC) id. (0~15 items, 32 bit each)
optional
Header extension (optional) header
Payload (real time data)
Padding (size Padding size
x 8 bits) (8bits) optional
Multihoming
Full-Duplex Communication
Connection-Oriented Service
Reliable Service
Multiple-stream concept
If oneof thestreamsisblocked,
theother streamscan still deliver
theirdata.
An association in SCTP can involve multiple
streams.
Multihoming concept
At present, SCTPdoesnot allowloadsharingbetween different path.
Currently, it is only for fault-tolerance.
SCTP Features
Transmission Sequence Number (TSN)
Packets
Acknowledgment Number
Flow Control
Error Control
Congestion Control
In SCTP, a data chunk is numbered using a
TSN.
of chunks.
2. data chunks.
SCTP packet format
In an SCTP packet, control chunks come
before data chunks.
General header (Common layout of a chunk)
In SCTP, control information and data
information are carried in separate chunks.
Delay
Bandwidth
Requirements
5-
30
Techniques to achieve Good QoS
● Buffering
● Scheduling
● FIFO queue
● Priority queuing
● Weighted fair queuing
● Traffic Shaping
● Leaky bucket algorithm
● Token bucket algorithm
● Resource reservation
Buffering
Smoothing the output stream by buffering packets.
FIFO queue
Priority queuing
Weighted fair queuing
The Leaky Bucket Algorithm
5-
34
5-
34
Outline
Services,
Addressing
Berkley Sockets,
Multiplexing,
TCP
Connection establishment,
Connection release,
Flow control and buffering,
TCPTimer management,
TCPCongestion Control,
UDP– (Gap Analysis) content beyond syllabus
RealTime Transport protocol(RTP),
Stream ControlTransmission Protocol (SCTP),
Quality of Service (QoS),
Differentiated services,
TCP and UDP forWireless. 8/ 21/ 2017
Integrated
Twomodels Services
toprovide
Quality of Service Differentiated
Services
Integrated Services
• Flow based QoSmodel
can give up the reserved resources once the need for them has
ended.
Path messages
Resv messages
Reservation merging
Reservation styles
Problems with Integrated Services
FH BS MH
Internet
Split TCP: Indirect TCP
• Pros
– Separates flow and congestion control of wireless and wired
--higher throughput at sender
• Cons
– BreaksTCP end-to-end semantics
• Ack at FH does not mean MH has received the packet
TCP SRP/UDP
Buffer
FH BS MH
Internet
Split-TCP: Mobile TCP
• Similar to I-TCP but tries to keepTCP end-to-end semantics
• No buffering , no retransmission at base station BS.
• BSonly monitors all packets and only acks the last packet
after it is received by MH
• Pros
– Data will be recovered eventually after BSfailure
– BSbuffer does not overflow
• Cons
– Worse performance
– Still not exactly theTCP semantics
TCP over Wireless : outline
• TCP overWireless: Problems
• TCP overWireless: Solutions (Schemes)
– SplitTCP
1. IndirectTCP
2. Selective repeat protocol
3. MobileTCP
– TCP-aware link layer
1.Snoop
2. WTCP
– Link layer protocol
– End-to-end protocol
1. SelectiveAcknowledgement
2. Explicit Loss Notification
TCP-aware Link Layers: Snoop
● Link layer is aware ofTCP traffic
● BScaches data and monitors acks. Retransmits on duplicate acks and
drops duplicate acks
FH BS MH
Internet
Packet 1
Packet 2 Packet 1
Packet 2 Ack 1
Ack 1 Ack 2
Packet 3 Ack 2
Packet 4 Packet 3
Packet 4
Ack 2
Blocks Dup-Ack
Packet 3
TCP-aware Link Layers: Snoop
● Pros
● No modification to FH and MH
● BSonly keeps soft state—BS failure does not breakTCP
● Cons
● Does not work with encrypted packets
● Does not work if data packets and acks traverse different paths
● Increases RTT—high timeout
TCP-aware Link Layers: WTCP
• Similar to Snoop
• WTCP corrects RTT by modifying the timestamp in return acks
FH BS MH
Internet
Packet 3
Packet 4 Packet 3
Log Arrival Time Packet 4
Delay
Ack 2
Packet 3
Ack’3