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

Week 5

The document discusses several key aspects of TCP including: 1. TCP is connection-oriented and establishes parameters between processes before data transfer. Routers are oblivious to TCP connections and see only datagrams. 2. TCP segments contain sequence numbers, acknowledgment numbers, flags, and windows which are used to implement reliable data transfer and flow control. 3. TCP provides reliable data transfer through mechanisms like slow start, congestion avoidance, fast retransmit, and timeout with exponential backoff to efficiently utilize available bandwidth while avoiding congestion.

Uploaded by

AKANKSHA RAJ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Week 5

The document discusses several key aspects of TCP including: 1. TCP is connection-oriented and establishes parameters between processes before data transfer. Routers are oblivious to TCP connections and see only datagrams. 2. TCP segments contain sequence numbers, acknowledgment numbers, flags, and windows which are used to implement reliable data transfer and flow control. 3. TCP provides reliable data transfer through mechanisms like slow start, congestion avoidance, fast retransmit, and timeout with exponential backoff to efficiently utilize available bandwidth while avoiding congestion.

Uploaded by

AKANKSHA RAJ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Selective Repeat ARQ: Window size

and Sequence Number Space


TCP: Transmission Control Protocol
• TCP is said to be connection-oriented because before one application
process can begin to send data to another, the two processes must
first “handshake” with each other—that is, they must send some
preliminary segments to each other to establish the parameters of
the ensuing data transfer
• In fact, the intermediate routers are completely oblivious to TCP
connections; they see datagrams, not connections.
TCP: Packet Format, Segmentation, MSS

a TCP connection consists of buffers, variables, and a socket connection to a


process in one host, and another set of buffers, variables, and a socket connection
to a process in another host. As mentioned earlier, no buffers or variables are
allocated to the connection in the network elements (routers, switches, and
repeaters) between the hosts.
TCP: Packet Format, Segmentation, MSS
The 32-bit sequence number field and the 32-bit acknowledgment The 16-bit receive window field is used for flow control. We will see
number field are used by the TCP sender and receiver in implementing shortly that it is used to indicate the number of bytes that a receiver is
a reliable data transfer service, willing to accept.

The optional and variable-length options field is used when a sender and
receiver negotiate the maximum segment size (MSS) or as a window
scaling factor for use in high-speed networks. A time-stamping option is
also defined.

The flag field contains 6 bits. The ACK bit is used to indicate that the value carried
in the acknowledgment field is valid; that is, the segment contains an
acknowledgment for a segment that has been successfully received. The RST, SYN,
and FIN bits are used for connection setup and teardown, as we will discuss at the
end of this section. Setting the PSH bit indicates that the receiver should pass the
data to the upper layer immediately. Finally, the URG bit is used to indicate that
there is data in this segment that the sending-side upper-layer entity has marked as
“urgent.” The location of the last byte of this urgent data is indicated by the 16-bit
urgent data pointer field. TCP must inform the receiving-side upper-layer entity
when urgent data exists and pass it a pointer to the end of the urgent data.

https://packetlife.net/blog/2011/mar/2/tcp-flags-psh-and-urg/
http://www.firewall.cx/networking-to
pics/protocols/tcp/137-tcp-window-s https://packetlife.net/blog/2011/mar/
ize-checksum.html 2/tcp-flags-psh-and-urg/
TCP Connection Establishment and Termination
Sequence and acknowledgment numbers for a simple
Telnet application over TCP
Round Trip Time Estimation and Timeout
The sample RTT, denoted SampleRTT, for a segment TCP maintains an average, called EstimatedRTT, of the
is the amount of time between when the segment is sent SampleRTT values. Upon obtaining a new SampleRTT, TCP
(that is, passed to IP) and when an acknowledgment for updates EstimatedRTT according to the following formula
the segment is received.

Instead of measuring a SampleRTT for every


transmitted segment, most TCP implementations take
only one SampleRTT measurement at a time.

That is, at any point in time, the SampleRTT is being


estimated for only one of the transmitted but currently
unacknowledged segments, leading to a new value of
SampleRTT approximately once every RTT.
The timeout interval should be greater than or equal to
Estimating Timeout EstimatedRTT, or unnecessary retransmissions would be
sent. But the timeout interval should not be too much larger than
EstimatedRTT; otherwise, when a segment
is lost, TCP would not quickly retransmit the segment,

An initial TimeoutInterval value of 1 second is


recommended [RFC 6298]. Also, when a timeout occurs,
the value of TimeoutInterval is doubled to avoid a
premature timeout occurring for a subsequent segment that
will soon be acknowledged.
Reliable Data Transfer in TCP
Doubling the timeout interval: Each
time TCP retransmits, it sets the next
timeout interval to twice the previous
value, rather than deriving it from the
last EstimatedRTT and DevRTT
Reliable Data Transfer: Fast Retransmit
Reliable Data Transfer in TCP: Fast Retransmit

If the TCP sender receives three duplicate ACKs for the same
data, it takes this as an indication that the segment following the
segment that has been ACKed three times has been lost.

In the case that three duplicate ACKs are received, the TCP
sender performs a fast retransmit [RFC 5681], retransmitting
the missing segment before that segment’s timer expires.
TCP Flow Control Service:
TCP provides a flow-control service to its applications to
eliminate the possibility of the sender overflowing the receiver’s
buffer. Flow control is thus a speed-matching service—matching
the rate at which the sender is sending against the rate at which
the receiving application is reading.

TCP provides flow control by having the sender maintain a


variable called the receive window. Informally, the receive
window is used to give the sender an idea of how much free
buffer space is available at the receiver.

Because TCP is full-duplex, the sender at each side of the


connection maintains a distinct receive window.

Host B tells Host A how much spare room it has in the connection buffer by placing its current value of rwnd in the
receive window field of every segment it sends to A. Initially, Host B sets rwnd = RcvBuffer.
TCP: Flow Control:
Host A in turn keeps track of two variables, LastByteSent and
Last-Byte Acked, which have obvious meanings. Note that the
difference between these two variables, LastByteSent –
LastByteAcked, is the amount of unacknowledged data that A has sent
into the connection.

By keeping the amount of unacknowledged data less than the value of rwnd,
Host A is assured that it is not overflowing the receive buffer at Host B.
TCP Connection Termination
TCP Connection Termination
when a host sends a reset segment, it is telling the source “I
don’t have a socket for that segment. Please do not resend the
segment.”
TCP Congestion Control
TCP sender perceives that there is little congestion on the path
between itself and the destination, then the TCP sender increases
its send rate; if the sender perceives that there is congestion
along the path, then the sender reduces its send rate.

But this approach raises three questions.


1. First, how does a TCP sender limit the rate at which it sends
traffic into its connection?
2. Second, how does a TCP sender perceive that there is
congestion on the path between itself and the destination?
3. And third, what algorithm should the sender use to change its
send rate as a function of perceived end-to-end congestion?

Specifically, the amount of unacknowledged data at a sender may not


exceed the minimum of cwnd and rwnd, that is:

LastByteSent – LastByteAcked min{cwnd, rwnd}


TCP Congestion Control
TCP uses acknowledgments to trigger (or clock) its increase in
congestion window size,TCP is said to be self-clocking.

A lost segment implies congestion, and hence, the TCP sender’s


rate should be decreased when a segment is lost.

An acknowledged segment indicates that the network is


delivering the sender’s segments to the receiver, and hence, the
sender’s rate can be increased when an ACK arrives for a
previously unacknowledged segment.

Bandwidth probing. Given ACKs indicating a congestion-free


source-to-destination path and loss events indicating a
congested path, TCP’s strategy for adjusting its transmission
rate is to increase its rate in response to arriving ACKs until a
loss event occurs, at which point, the transmission rate is
decreased.

TCP Congestion control algorithm has three components


Slow Start, Congestion Avoidance and Fast Recovery
TCP Congestion
Control

https://tools.ietf.org/html/rfc2001
TCP Congestion Control: Reno and Tahoe
Network Layer
The role of the network layer is deceptively simple—to move
packets from a sending host to a receiving host. To do so, two
important network-layer functions can be identified:

Forwarding. When a packet arrives at a router’s input link, the


router must move the packet to the appropriate output link. For
example, a packet arriving from Host H1 to Router R1 must be
forwarded to the next router on a path to H2.

Routing. The network layer must determine the route or path


taken by packets as they flow from a sender to a receiver. The
algorithms that calculate these paths are referred to as routing
algorithms.
Network Layer: Connection/Connectionless
Packet Switching
Network Layer also provide connection oriented and connectionless services in a way similar to the Transport Layer

Computer networks that provide only a connection service at the


network layer are called virtual-circuit (VC) networks;
computer networks that provide only a connectionless service at
the network layer are called datagram networks
Network Layer: Virtual Circuit Networks
There are three identifiable phases in a virtual circuit:

VC setup. During the setup phase, the sending transport layer


contacts the network layer, specifies the receiver’s address, and
waits for the network to set up the VC. The network layer
determines the path between sender and receiver, that is, the
series of links and routers through which all packets of the VC
will travel.

Data Transfer

VC Teardown

There are global and local addresses[VC Identifier]


Virtual Circuit Networks

https://www.cpe.ku.ac.th/~plw/dccn/presentation/ch08.pdf
Datagram Networks
In a datagram network, each time an end system wants to send Specifically, each router has a forwarding table that maps
a packet, it stamps the packet with the address of the destination destination addresses to link interfaces; when a packet arrives at
end system and then pops the packet into the network. the router, the router uses the packet’s destination address to
look up the appropriate output link interface in the forwarding
table.

longest prefix matching rule

Routers in datagram networks maintain no connection state


information, they nevertheless maintain forwarding state
information in their forwarding tables.

Internet runs as a Datagram Network


Comparison
Router
An input port performs several key functions

port here—
referring to the physical input and output router interfaces

Control packets (for example, packets carrying routing


protocol information) are forwarded from an input
port to the routing processor.

The switching fabric connects the router’s input ports to its


output ports.

An output port stores packets received from the switching fabric


and transmits these packets on the outgoing link by performing
the necessary link-layer and physical-layer functions

The routing processor executes the routing protocols maintains


routing tables and attached link state information, and computes
the forwarding table for the router.
Router: Forwarding/Control Plane/Input Processing
A router’s input ports, output ports, and switching fabric These forwarding functions are sometimes collectively referred
together implement the forwarding function and are almost to as the router forwarding plane
always implemented in hardware,

These router control plane functions are usually implemented


While the forwarding plane operates at the nanosecond time
in software and execute on the routing
scale, a router’s control functions—executing the routing
processor
protocols operate at the millisecond or second timescale.

With a shadow copy, forwarding decisions can be made locally,


The forwarding table is computed and updated by the routing
at each input port, without invoking the centralized routing
processor, with a shadow copy typically stored at each input
processor on a per-packet basis and thus avoiding a centralized
port.
processing bottleneck.

With a TCAM [Ternary Content Addressable Memory], a 32-bit


IP address is presented to the memory, which returns the content
of the forwarding table entry for that address in essentially “match plus action” abstraction
constant time.
Switching
The switching fabric is at the very heart of
a router, as it is through this fabric that the
packets are actually switched (that is,
forwarded) from an input port to an
output port.

Memory: Switching between input


and output ports being done under
direct control of the CPU (routing
processor).

if the memory bandwidth is such that B packets per second can be written
into, or read from, memory, then the overall forwarding throughput (the total
rate at which packets are transferred from input ports to output ports) must be
less than B/2
Switching
Switching via a bus. In this approach, an input
port transfers a packet directly to the
output port over a shared bus

This is typically done by having the input port


pre-pend a switch-internal label (header) to
the packet indicating the local output port to
which this packet is being transferred
and transmitting the packet onto the bus.

The packet is received by all output ports,


but only the port that matches the label will
keep the packet.

If multiple packets arrive to the router at the same time, each at


a different input port, all but one must wait since only one Because every packet must cross the single bus, the switching
packet can cross the bus at a time. speed of the router is limited to the bus speed;
Switching
A crossbar switch is an interconnection
network consisting of 2N buses that connect
N input ports to N output ports

Each vertical bus intersects each horizontal


bus at a cross point, which
can be opened or closed at any time by the
switch fabric controller

When a packet arrives from port A and needs


to be forwarded to port Y, the switch
controller closes the crosspoint at the
intersection of busses A and Y, and port Athen
sends the packet onto its bus, which is picked
up (only) by bus Y.
Output Processing packet queues may form at both the input ports and the output
ports

The location and extent of queueing (either at the input port


queues or the output port queues) will depend on the traffic load,
the relative speed of the switching fabric, and the line speed

A consequence of output port queuing is that a packet


scheduler at the output port must choose one packet among
those queued for transmission
Switching: Head Of Line (HOL) Blocking

input-queued switch—a queued packet in an input queue must


wait for transfer through the fabric (even though its output port
is free) because it is blocked by another packet at the head of the
line.
IP: Forwarding and Addressing
IPV4

https://www.eit.lth.se/ppplab/IPHeader.htm

You might also like