0% found this document useful (0 votes)
458 views91 pages

Advanced Computer Network by Prof Dayanand Ambawade

The document describes an introduction to an advanced networking course, including revisiting basics like the Internet, TCP/IP, IP, and UDP/TCP. The course will then cover topics like IP routing, network congestion, multicast, and Internet multimedia communications. Instructor contact information and course resources are also provided.
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)
458 views91 pages

Advanced Computer Network by Prof Dayanand Ambawade

The document describes an introduction to an advanced networking course, including revisiting basics like the Internet, TCP/IP, IP, and UDP/TCP. The course will then cover topics like IP routing, network congestion, multicast, and Internet multimedia communications. Instructor contact information and course resources are also provided.
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/ 91

Advanced Networking

Renato Lo Cigno
[email protected] - Tel: 2026
Csaba Kiraly (helps with projects & Seminars)

Dipartimento di Ingegneria e Scienza dell’Informazione


Homepage:
disi.unitn.it/locigno/ -> teching duties
What do you find on the web site
• Exam Rules
• Exam Details ... should be on ESSE3, but ...
• Generic (useful) information
• Teaching Material: normally posted at least the day
before the lesson
• Additional Material and links
• News, Bulletin, How to find and meet me, etc.
• ...

The web site is work in progress and updated frequently, so


please drop by frequently and don’t blame ME if you did’t
read the last news ☺

[email protected] Advanced Networking – Introduction 2


Program
• Course Perspective
– what do we learn and what we do not
– are there other “networks”

• Reharsal of basics
– Internet and TCP/IP
– THE network? or YetAnother network
– IP
– UDP/TCP

[email protected] Advanced Networking – Introduction 3


Program
• IP and routing
– OSPF and link-state protocols
• Intra AS routing
• performance driven routing

– BGP and policy-based protocols


• External routing
• Cost (economical!) based routing

– Global routing and Internet topology


• How things look and works end-to-end

[email protected] Advanced Networking – Introduction 4


Program
• Network congestion
– Network load and stability
– Call Admission Control
– Reactive congestion control
• Closed-loop systems
• Implicit/Explicit
• Forward
• Backward
– TCP
• How it really works
– TCP stabilization methods: mith and reality
• RED, RIO, ...

[email protected] Advanced Networking – Introduction 5


Program
• Multicast
– Abstract multicasting
– Multicast groups and addresses
– Internet and multicast: IGMP
– Multicast routing
– Application level multicast
• why it’s absurd ...
• ... why it works!!!

[email protected] Advanced Networking – Introduction 6


Program
• Internet multimedia communications
– Voice and Video services on packet-based networks
– Transport: RTP/RTCP
– SIP standard
– H.323 standard
– Skype and P2P approaches

– IP TV
• VoD/Broadcast/Live
• Traditional approach
• P2P systems

[email protected] Advanced Networking – Introduction 7


• Recalling known topics:

- Internet
- IP
- UDP/TCP
Acknowledment:
The following slides are based on the slides developed by
J.Kurose and K.Ross to accompany their book “Computer Networks:
A Top Down Approach Featuring the Internet” by Wiley edts.
Internet

What we see: What is it:


• Services • A collection of protocols
• Applications we use • Mainly centered around two
centerpieces:
• Some “application
– IP (network layer)
level” protocols
– UDP/TCP (transport layer)
• Throughput • Does not mandate a physical
• Losses medium or format
• Delay (sometimes) • Does not mandate or limit the
services/applications above
• Delay Jitter (if we’re (integrates services)
really skilled!)

[email protected] Advanced Networking – Introduction 9


IP: The Network Layer

Goals: Overview:
• recall principles • network layer services
behind network layer • routing principle: path
services: selection
– routing (path
• IP
selection)
– dealing with scale • Internet routing
– how a router works protocols reliable
transfer
– intra-domain
• instantiation and
– inter-domain
implementation in
the Internet • what’s inside a router?

[email protected] Advanced Networking – Introduction 10


Network layer functions
• transport packet from
sending to receiving hosts
application
• network layer protocols in transport

every host, router network


data link network
physical data link
network network
physical
three important functions: data link
physical
data link
physical

• path determination: route network


data link
taken by packets from source physical network
data link
to dest. Routing algorithms physical

• switching: move packets from network


network
data link
data link physical
router’s input to appropriate physical

router output network


data link application
physical transport
• call setup: some network network
data link
architectures require router physical

call setup along path before


data flows

[email protected] Advanced Networking – Introduction 11


Network service model

Q: What service model


for “channel”
The most important
transporting packets abstraction provided
from sender to by network layer:
receiver?
• guaranteed bandwidth?
? ?
virtual circuit
service abstraction

• preservation of inter-packet or
timing (no jitter)?
• loss-free delivery?
• in-order delivery?
• congestion feedback to
? datagram?

sender?

[email protected] Advanced Networking – Introduction 12


Virtual circuits
“source-to-dest path behaves much like telephone
circuit”
– performance-wise
– network actions along source-to-dest path
• call setup, teardown for each call before data can flow
• each packet carries VC identifier (not destination host OD)
• every router on source-dest path s maintain “state” for each
passing connection
– transport-layer connection only involved two end systems
• link, router resources (bandwidth, buffers) may be allocated to VC
– to get circuit-like perf.

[email protected] Advanced Networking – Introduction 13


Virtual circuits: signaling protocols

• used to setup, maintain teardown VC


• used in ATM, frame-relay, X.25
• not used in today’s Internet

application
6. Receive data application
transport 5. Data flow begins
network 4. Call connected 3. Accept call transport
data link 1. Initiate call 2. incoming call network
data link
physical
physical

[email protected] Advanced Networking – Introduction 14


Datagram networks: the Internet model

• no call setup at network layer


• routers: no state about end-to-end connections
– no network-level concept of “connection”
• packets typically routed using destination host ID
– packets between same source-dest pair may take
different paths

application
application
transport
transport
network
data link 1. Send data 2. Receive data network
data link
physical
physical

[email protected] Advanced Networking – Introduction 15


Routing

Routing protocol
Goal: determine “good” path 5
(sequence of routers) thru 3
network from source to dest. B C 5
2
A 2 1 F
3
Graph abstraction for 1 2
routing algorithms: D E
1
• graph nodes are
routers • “good” path:
• graph edges are – typically means minimum
physical links cost path
– link cost: delay, $ cost, – other def’s possible
or congestion level

[email protected] Advanced Networking – Introduction 16


Routing Algorithm classification

Global or decentralized Static or dynamic?


information? Static:
Global: • routes change slowly over
• all routers have complete time
topology, link cost info Dynamic:
• “link state” algorithms • routes change more quickly
Decentralized: – periodic update
• router knows physically- – in response to link cost
connected neighbors, link changes
costs to neighbors
• iterative process of
computation, exchange of
info with neighbors
• “distance vector” algorithms

[email protected] Advanced Networking – Introduction 17


A Link-State Routing Algorithm

Dijkstra’s algorithm Notation:


• net topology, link costs known • c(i,j): link cost from node i to j.
to all nodes cost infinite if not direct
– accomplished via “link state neighbors
broadcast”
• D(v): current value of cost of
– all nodes have same info path from source to dest. V
• computes least cost paths
• p(v): predecessor node along
from one node (‘source”) to all
path from source to v, that is
other nodes
next v
– gives routing table for that
node • N: set of nodes whose least
cost path definitively known
• iterative: after k iterations,
know least cost path to k
dest.’s

[email protected] Advanced Networking – Introduction 18


Dijsktra’s Algorithm

1 Initialization:
2 N = {A}
3 for all nodes v
4 if v adjacent to A
5 then D(v) = c(A,v)
6 else D(v) = infty
7
8 Loop
9 find w not in N such that D(w) is a minimum
10 add w to N
11 update D(v) for all v adjacent to w and not in N:
12 D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N

[email protected] Advanced Networking – Introduction 19


Dijkstra’s algorithm: example

Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F)


0 A 2,A 5,A 1,A infinity infinity
1 AD 2,A 4,D 2,D infinity
2 ADE 2,A 3,E 4,E
3 ADEB 3,E 4,E
4 ADEBC 4,E
5 ADEBCF

B 3 C
2 5
A 2 1 F
3
1 2
D E
1

[email protected] Advanced Networking – Introduction 20


Dijkstra’s algorithm, discussion

Algorithm complexity: n nodes


• each iteration: need to check all nodes, w, not in N
• n*(n+1)/2 comparisons: O(n**2)
• more efficient implementations possible: O(nlogn)
Oscillations possible:
• e.g., link cost = amount of carried traffic

1 A A A A
1+e 2+e 0 0 2+e 2+e 0
D 0 0 B D B D B D 1+e 1 B
1+e 1 0 0
0 e 0 0 1 1+e 0 e
1
C C C C
1
e
… recompute … recompute … recompute
initially
routing
[email protected] Advanced Networking – Introduction 21
Distance Vector Routing Algorithm

iterative:
Distance Table data structure
• continues until no
nodes exchange info. • each node has its own
• self-terminating: no • row for each possible destination
“signal” to stop • column for each directly-
attached neighbor to node
asynchronous:
• example: in node X, for dest. Y
• nodes need not
via neighbor Z:
exchange info/iterate
in lock step!
distributed: distance from X to
X = Y, via Z as next hop
• each node
D (Y,Z)
communicates only with Z
directly-attached = c(X,Z) + minw{D (Y,w)}
neighbors

[email protected] Advanced Networking – Introduction 22


Distance Table: example

1 cost to destination via


B C E
7 D () A B D
A 8 2
1 A 1 14 5
E D
2
B 7 8 5

destination
E D
D (C,D) = c(E,D) + minw {D (C,w)}
= 2+2 = 4 C 6 9 4
E D
D (A,D) = c(E,D) + minw {D (A,w)}
D 4 11 2
= 2+3 = 5 loop!
E B
D (A,B) = c(E,B) + minw{D (A,w)}
= 8+6 = 14
loop!
[email protected] Advanced Networking – Introduction 23
Distance table gives routing table

cost to destination via


E Outgoing link
D () A B D to use, cost

A 1 14 5 A A,1

B 7 8 5
destination

B D,5

destination
C 6 9 4 C D,4

D 4 11 2 D D,4

Distance table Routing table

[email protected] Advanced Networking – Introduction 24


Distance Vector Routing: overview

Iterative, asynchronous: Each node:


each local iteration caused
by:
• local link cost change wait for (change in local link
• message from neighbor: its cost of msg from neighbor)
least cost path change
from neighbor
Distributed: recompute distance table
• each node notifies
neighbors only when its
least cost path to any if least cost path to any dest
destination changes has changed, notify
– neighbors then notify neighbors
their neighbors if
necessary

[email protected] Advanced Networking – Introduction 25


Distance Vector Algorithm:

At all nodes, X:
1 Initialization:
2 for all adjacent nodes v:
3 D X(*,v) = infty /* the * operator means "for all rows" */
X
4 D (v,v) = c(X,v)
5 for all destinations, y
X
6 send min D (y,w) to each neighbor /* w over all X's neighbors */
w

[email protected] Advanced Networking – Introduction 26


Distance Vector Algorithm (cont.):
8 loop
9 wait (until I see a link cost change to neighbor V
10 or until I receive update from neighbor V)
11
12 if (c(X,V) changes by d)
13 /* change cost to all dest's via neighbor v by d */
14 /* note: d could be positive or negative */
15 for all destinations y: D (y,V) = D (y,V) + d
16 X X
17 else if (update received from V wrt destination Y)
18 /* shortest path from V to some Y has changed */
19 /* V has sent a new value for its min DV(Y,w) */
20 /* call this received new value is "newval" */
w
21 for the single destination y: D (Y,V) = c(X,V) + newval
22 X
23 if we have a new min D (Y,w)for any destination Y
24 send new value of min XD (Y,w) to all neighbors
w X
25
w
26 forever
[email protected] Advanced Networking – Introduction 27
Distance Vector Algorithm: example

Y
2 7
X Z
1

[email protected] Advanced Networking – Introduction 28


Distance Vector Algorithm: example

Y
2 7
X Z X Z
1 D (Y,Z) = c(X,Z) + minw{D (Y,w)}
= 7+1 = 8

X Y
D (Z,Y) = c(X,Y) + minw {D (Z,w)}
= 2+1 = 3

[email protected] Advanced Networking – Introduction 29


Distance Vector: link cost changes

Link cost changes:


1
• node detects local link cost change Y
• updates distance table (line 15) 4 1
X Z
• if cost change in least cost path, 50
notify neighbors (lines 23,24)

algorithm
terminates
“good
news
travels
fast”

[email protected] Advanced Networking – Introduction 30


Distance Vector: link cost changes

Link cost changes: 60


• good news travels fast Y
4 1
• bad news travels slow - X Z
“count to infinity” problem! 50

algorithm
continues
on!

[email protected] Advanced Networking – Introduction 31


Distance Vector: poisoned reverse

If Z routes through Y to get to X : 60


• Z tells Y its (Z’s) distance to X is Y
4 1
infinite (so Y won’t route to X via Z)
X Z
• will this completely solve count to 50
infinity problem?
algorithm
terminates

[email protected] Advanced Networking – Introduction 32


Comparison of LS and DV algorithms

Message complexity Robustness: what happens


• LS: with n nodes, E links, if router malfunctions?
O(nE) msgs sent each LS:
• DV: exchange between
– node can advertise
neighbors only
incorrect link cost
– convergence time varies
– each node computes only
Speed of Convergence its own table
• LS: O(n**2) algorithm DV:
requires O(nE) msgs – DV node can advertise
– may have oscillations incorrect path cost
• DV: convergence time varies – each node’s table used by
– may be routing loops others
• error propagate thru
– count-to-infinity problem
network

[email protected] Advanced Networking – Introduction 33


The Internet Network layer
Host, router network layer functions:

Transport layer: TCP, UDP

Routing protocols IP protocol


•path selection •addressing conventions
•RIP, OSPF, BGP •datagram format
Network •packet handling conventions
layer routing
table ICMP protocol
•error reporting
•router “signaling”

Link layer

physical layer

[email protected] Advanced Networking – Introduction 34


Why different Intra- and Inter-AS routing ?

• Policy: Inter is concerned with policies (which provider


we must select/avoid, etc). Intra is contained in a single
organization, so, no policy decisions necessary
• Scale: Inter provides an extra level of routing table size
and routing update traffic reduction above the Intra
layer
• Performance: Intra is focused on performance metrics;
needs to keep costs low. In Inter it is difficult to
propagate performance metrics efficiently (latency,
privacy etc). Besides, policy related information is more
meaningful.
We need BOTH!

[email protected] Advanced Networking – Introduction 35


• IP address: 32-bit IP Addressing
identifier for host,
router interface 223.1.1.1
• interface: connection 223.1.2.1
between host, router and 223.1.1.2
223.1.1.4 223.1.2.9
physical link
– router’s typically have 223.1.3.27
223.1.2.2
223.1.1.3
multiple interfaces
– host may have multiple
interfaces
223.1.3.1 223.1.3.2
– IP addresses associated
with interface, not host,
router, …
• Address mng & resolution
223.1.1.1 = 11011111 00000001 00000001 00000001
+ DNS must be known well
we do not repeat it 223 1 1 1

[email protected] Advanced Networking – Introduction 36


Router Architecture Overview
• Router main functions: routing algorithms and
protocols processing, switching datagrams from an
incoming link to an outgoing link

Router Components
[email protected] Advanced Networking – Introduction 37
Input Ports

• Decentralized switching: perform routing table lookup using a


copy of the node routing table stored in the port memory
• Goal is to complete input port processing at ‘line speed’, ie
processing time =< frame reception time (eg, with 2.5 Gbps
line, 256 bytes long frame, router must perform about 1
million routing table lookups in a second)
• Queuing occurs if datagrams arrive at rate higher than can be
forwarded on switching fabric

[email protected] Advanced Networking – Introduction 38


Speeding Up Routing Table Lookup

• Table is stored in a tree structure to


facilitate binary search
• Content Addressable Memory (associative
memory), eg Cisco 8500 series routers
• Caching of recently looked-up addresses
• Compression of routing tables

[email protected] Advanced Networking – Introduction 39


Switching Fabric

[email protected] Advanced Networking – Introduction 40


Switching Via Memory
•First generation routers: packet is copied under
system’s (single) CPU control; speed limited by Memory
bandwidth. For Memory speed of B packet/sec or pps,
throughput is B/2 pps
Input Memory Output
Port Port

System Bus

• Modern routers: input ports with CPUs that implement output


port lookup, and store packets in appropriate locations (= switch)
in a shared Memory; eg Cisco Catalyst 8500 switches

[email protected] Advanced Networking – Introduction 41


Switching Via Bus
• Input port processors transfer a datagram from
input port memory to output port memory via a
shared bus
• Main resource contention is over the bus;
switching is limited by bus speed
• Sufficient speed for access and enterprise
routers (not regional or backbone routers) is
provided by a Gbps bus; eg Cisco 1900 which has a
1 Gbps bus

[email protected] Advanced Networking – Introduction 42


Switching Via An Interconnection
Network

• Used to overcome bus bandwidth limitations


• Banyan networks and other interconnection networks
were initially developed to connect processors in a
multiprocessor computer system; used in Cisco 12000
switches provide up to 60 Gbps through the
interconnection network
• Advanced design incorporates fragmenting a datagram
into fixed length cells and switch the cells through the
fabric; + better sharing of the switching fabric resulting
in higher switching speed

[email protected] Advanced Networking – Introduction 43


Output Ports

Buffering is required to hold datagrams whenever


they arrive from the switching fabric at a rate
faster than the transmission rate

[email protected] Advanced Networking – Introduction 44


Queuing At Input and Output Ports
• Queues build up whenever there is a rate mismatch or blocking.
Consider the following scenarios:
– Fabric speed is faster than all input ports combined; more
datagrams are destined to an output port than other output
ports; queuing occurs at output port
– Fabric bandwidth is not as fast as all input ports combined;
queuing may occur at input queues;
– HOL blocking: fabric can deliver datagrams from input ports in
parallel, except if datagrams are destined to same output port;
in this case datagrams are queued at input queues; there may be
queued datagrams that are held behind HOL conflict, even when
their output port is available

[email protected] Advanced Networking – Introduction 45


Transport Layer: UDP & TCP

Goals: Overview:
• Recall principles behind • transport layer services
transport layer services: • multiplexing/demultiplexing
– multiplexing/demultiplex • connectionless transport: UDP
ing
• principles of reliable data
– reliable data transfer
transfer
– flow control
• connection-oriented transport:
– congestion control
TCP
• instantiation and
– reliable transfer
implementation in the
– flow control
Internet
– connection management

[email protected] Advanced Networking – Introduction 46


Transport services and protocols

• provide logical communication application


transport
between app’ processes network
data link
running on different hosts physical
network
data link
network

lo
physical
• transport protocols run in

gi
data link

ca
physical
end systems (primarily)

l
network

en
data link

d-
physical network

en
transport vs network layer data link

d
physical

tr
services:

an
network

sp
data link
• network layer: data transfer

or
physical

t
between end systems
application
• transport layer: data transport
network
transfer between processes data link
physical

– relies on, enhances, network


layer services

[email protected] Advanced Networking – Introduction 47


Transport-layer protocols

Internet transport services: application


transport
• reliable, in-order unicast network
data link network
delivery (TCP) physical data link
network

lo
physical
– congestion

gi
data link

ca
physical

l
– flow control network

en
data link

d-
– connection setup physical network

en
data link

d
physical

tr
• unreliable (“best-effort”),

an
network

sp
unordered unicast or data link

or
physical

t
multicast delivery: UDP
• services not available: application
transport
network
– real-time data link
physical
– bandwidth guarantees
– reliable multicast

[email protected] Advanced Networking – Introduction 48


Multiplexing/demultiplexing

Recall: segment - unit of data


Demultiplexing: delivering
exchanged between
received segments (TPDUs)to
transport layer entities correct app layer processes
– aka TPDU: transport
protocol data unit
receiver
P3 P4
application-layer M M
data
application
segment P1 transport P2
header M
M network
application application
segment Ht M transport transport
network
Hn segment network

[email protected] Advanced Networking – Introduction 49


Multiplexing/demultiplexing
Multiplexing:
gathering data from multiple
app processes, enveloping
data with header (later used 32 bits
for demultiplexing)
source port # dest port #

multiplexing/demultiplexing:
other header fields
• based on sender, receiver port
numbers, IP addresses
– source, dest port #s in
each segment application
data
– recall: well-known port
(message)
numbers for specific
applications
TCP/UDP segment format

[email protected] Advanced Networking – Introduction 50


Multiplexing/demultiplexing: examples

source port: x WWW client


host A dest. port: 23 server B host C

source port:23
dest. port: x
Source IP: C Source IP: C
Dest IP: B Dest IP: B
source port: y source port: x
port use: simple telnet app dest. port: 80 dest. port: 80

Source IP: A
Dest IP: B WWW
WWW client source port: x server B
host A dest. port: 80
port use: WWW server

[email protected] Advanced Networking – Introduction 51


UDP: User Datagram Protocol [RFC 768]
• “no frills,” “bare bones”
Internet transport Why is there a UDP?
protocol
• no connection
• “best effort” service, UDP establishment (which can
segments may be: add delay)
– lost • simple: no connection state
– delivered out of order at sender, receiver
to app • small segment header
• connectionless: • no congestion control: UDP
– no handshaking between can blast away as fast as
UDP sender, receiver desired
– each UDP segment
handled independently
of others

[email protected] Advanced Networking – Introduction 52


UDP: more
• often used for streaming
multimedia apps 32 bits

– loss tolerant Length, in source port # dest port #


– rate sensitive bytes of UDP length checksum
segment,
• other UDP uses including
(why?): header
– DNS
– SNMP Application
data
• reliable transfer over UDP:
(message)
add reliability at
application layer
– application-specific
UDP segment format
error recover!

[email protected] Advanced Networking – Introduction 53


UDP checksum

Goal: detect “errors” (e.g., flipped bits) in transmitted


segment
Sender:
• treat segment contents as Receiver:
sequence of 16-bit integers • compute checksum of
• checksum: addition (1’s received segment
complement sum) of segment • check if computed checksum
contents equals checksum field value:
• sender puts checksum value – NO - error detected
into UDP checksum field
– YES - no error detected.
But maybe errors
nonethless?

[email protected] Advanced Networking – Introduction 54


Principles of Reliable data transfer

• important in app., transport, link layers


• top-10 list of important networking topics!

• characteristics of unreliable channel will determine


complexity of reliable data transfer protocol (rdt)
[email protected] Advanced Networking – Introduction 55
Reliable data transfer: getting started

rdt_send(): called from above, deliver_data(): called by


(e.g., by app.). Passed data to rdt to deliver data to upper
deliver to receiver upper layer

send receive
side side

udt_send(): called by rdt, rdt_rcv(): called when packet


to transfer packet over arrives on rcv-side of channel
unreliable channel to receiver

[email protected] Advanced Networking – Introduction 56


Reliable data transfer: getting started

We’ll:
• incrementally develop sender, receiver sides of
reliable data transfer protocol (rdt)
• consider only unidirectional data transfer
– but control info will flow on both directions!
• use finite state machines (FSM) to specify
sender, receiver
event causing state transition
actions taken on state transition
state: when in this
“state” next state state state
1 event
uniquely determined 2
by next event actions

[email protected] Advanced Networking – Introduction 57


rdt: channels with errors and loss

Assumption: underlying
channel can lose packets
Approach: sender waits
(data or ACKs)
“reasonable” amount of
– checksum, seq. #, ACKs,
retransmissions will be of
time for ACK
help, but not enough • retransmits if no ACK
received in this time
Q: how to deal with loss?
• if pkt (or ACK) just delayed
– sender waits until certain (not lost):
data or ACK lost, then
– retransmission will be
retransmits
duplicate, but use of seq.
– yuck: drawbacks? #’s already handles this
– receiver must specify seq
# of pkt being ACKed
• requires countdown timer

[email protected] Advanced Networking – Introduction 58


rdt: sender

[email protected] Advanced Networking – Introduction 59


rdt in action

[email protected] Advanced Networking – Introduction 60


rdt in action

[email protected] Advanced Networking – Introduction 61


Performance of rdt

• rdt works, but performance stinks


• example: 1 Gbps link, 15 ms e-e prop. delay, 1KB packet:

8kb/pkt
Ttransmit = = 8 microsec
10**9 b/sec
fraction of time 8 microsec
Utilization = U = sender busy sending = = 0.00015
30.016 msec

– 1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps link
– network protocol limits use of physical resources!

[email protected] Advanced Networking – Introduction 62


Pipelined Protocols
• Channel utilization under a Stop&Wait protocol is not
high when the propagation time is long relative to the
transmission time
• Solution: pipelined protocols, where more than one
packet can be sent without waiting for feedback, thus
filling the ‘pipeline’
• Two major versions (and lots of variations on the theme):
– Go-Back-N
– Selective Repeat
• New requirements:
– Buffering more than one packet at sender, and possibly at
receiver too
– Larger sequence numbers for identifying packets in transit

[email protected] Advanced Networking – Introduction 63


Filling the Pipeline

[email protected] Advanced Networking – Introduction 64


Stop&Wait Efficiency
Tdatatrans
U= Sender Receiver
Tdatatrans + 2 * T prop + T proc + Tacktrans
For relatively small T proc and Tacktrans T prop
Tdatatrans
U≈ , or
Tdatatrans + 2 * T prop
Tdatatrans
1 T prop
U≈ , where a =
1+ 2 * a Tdatatrans
L
Tdatatrans = , where L is the Packet T proc
C Tacktrans
length and C is the Transmissi on Speed.
For one bit of data, Tdatatrans = 1/C;
T prop
in this case a = CT prop , which is
called the " Bandwidth - Delay"
product

[email protected] Advanced Networking – Introduction 65


Go-Back-N

• Sender can go ahead and transmit packets without


waiting for feedback up to some number of
packets (for flow control reasons, details later)
• Definitions:
N: maximum allowable number of transmission without
feedback
Base: lowest sequence number of unacked packets
Nextseqnum: lowest unused sequence number
Maxseqnum: largest sequence number

[email protected] Advanced Networking – Introduction 66


Go-Back-N Window
• From definitions and figure above:
[0, base-1] transmitted and acked
[base, nextseqnum-1] transmitted and waiting
for feedback, or ‘outstanding’
[nextseqnum, base+N-1] numbers that can be
used when packets are
provided by higher layer for
transmission
[base+N, maxseqnum] numbers that cannot be
used until more packets are
acked

[email protected] Advanced Networking – Introduction 67


Go-Back-N Window (Cont.)
• Because of the window metaphor, these
protocols are also referred to as sliding window
protocols
• Stop&Wait can be viewed as a sliding window
protocol, with window size N = 1, and sequence
space = [0,1]
• Sequence number is carried in a fixed length
field in the packet header; with k bits in the
Sequence number field, the sequence space is
• Since sequence numbers must wrap around, all
sequence number arithmetic is modulo
[email protected] Advanced Networking – Introduction 68
Go-Back-N Sender

Window NOT full

No other packets outstanding

Acks are cumulative

?
No packets
outstanding
[email protected] Advanced Networking – Introduction 69
Go-Back-N Receiver

• Receiver accepts packets in order only! out-of-order packets are


simply dropped

[email protected] Advanced Networking – Introduction 70


Go-Back-N Example (N=4)

[email protected] Advanced Networking – Introduction 71


Go-Back-N Performance
• Bandwidth-Delay Product (ie “pipeline size”) is
defined as the product of the channel
transmission speed and the propagation delay
• As transmission speed or propagation delay
increases, more packets can be transmitted to
“fill the pipeline”
• For channels with high Bandwidth-Delay product,
Go-Back-N performance may deteriorate: the
number of outstanding packets may be large and
all these packets will be unnecessarily
retransmitted when an error occurs

[email protected] Advanced Networking – Introduction 72


Selective Repeat
• Selective Repeat addresses the performance limitation
of Go-back-N mentioned above
• Receiver indicates to sender which packet needs to be
retransmitted; sender retransmits only that packet
• Receiver accepts and buffers packets received out of
order within a limit imposed by a receiver window
• Groups of packets with consecutive sequence numbers (or
completed sequences) are delivered to the higher layer at
the sender
• A timer must be associated with each packet (but we can
use one hardware timer to implement multiple logical
timers)

[email protected] Advanced Networking – Introduction 73


Selective Repeat Windows

[email protected] Advanced Networking – Introduction 74


Selective Repeat Sender Event-
Driven Algorithms
• Higher layer calls to transmit data:
if there are unused sequence numbers
then packetize and transmit;
else reject the data;
• Timeout occurs:
transmit the (single) packet which timed out;
• Ack is received:
mark packet acked;
if base can be moved
then move it to the unacked packet with the lowest sequence
number;

[email protected] Advanced Networking – Introduction 75


Selective Repeat Receiver Event-
Driven Algorithms
• Packet received, not corrupted, within current receive
window:
Ack the received packet;
if not previously received
then buffer the packet;
deliver consectively sequenced received packets to higher layer;
move window forward;
• Packet received, not corrupt, sequence number below
window base:
Ack the received packet; /* packet previously acked and already
delivered to higher layer*/
• Packet received, corrupt, or sequence number beyond
window:
Ignore the packet
[email protected] Advanced Networking – Introduction 76
Selective Repeat Example

[email protected] Advanced Networking – Introduction 77


Setting The Window Size
• The window size N is an important parameter
• N should be large enough to allow filling the
pipeline, thus making better utilization of the
channel
• On the other hand, N is limited by the protocols
(ensure receiver correctly identifies packets)
• It was found that N cannot be larger than half
the sequence space length

[email protected] Advanced Networking – Introduction 78


Misidentification Example

[email protected] Advanced Networking – Introduction 79


Reliable Transport Layer: TCP
• Full-duplex
• End-to-end protocol, transparent to network and
lower layers in routers
• Connection-oriented, connection established
through “three way handshake” protocol
• Byte Stream transfer, stream is divided into
segments with a maximum segment size (MSS)
• Reliability through an ARQ type protocol
• Flow Control: receiver controls the amount of bytes
a sender is allowed to send
• Point-to-point connection, no multicasting with TCP
[email protected] Advanced Networking – Introduction 80
TCP Connection Model

[email protected] Advanced Networking – Introduction 81


Telnet: A TCP ACK example
• Telnet: appl. level protocol for remote login
• Interactive mode; typed characters are “echoed
back” by remote Host (each character traverses
the network twice)
• Full duplex stream of characters provides
opportunity for ACK piggybacking
• In simplex (one way) data transfer, explicit
ACKs are required

[email protected] Advanced Networking – Introduction 82


Telnet: ACK Example

[email protected] Advanced Networking – Introduction 83


TCP Reliable Data Transfer
• IP layer is often unreliable: packet drop (due to
buffer overflow); data corruption (eg, noise,
collisions).
• TCP approach: data is retransmitted following error
detection (bad checksum) or packet loss detection
(timeout or out of sequence reception)
• TCP uses pipelining to improve efficiency over paths
with many hops and large end to end delays
• TCP error recovery mechanism similar to Go-Back-N
• TCP RFCs do not require receivers to drop out-of-
order packets; some implementation keep such
packets to save channel bandwidth

[email protected] Advanced Networking – Introduction 84


Three Key Events In Reliable TCP

• Event 1: TCP releases data segment to IP


layer; segment retx timer started
• Event 2: segment timeout expires: segment is
retransmitted
• Event 3: sender receives an ACK:
(a) First Time ACK, ie the ACK is for data not acked
before (nextseqnum > ACK # > sendbase); the
sender updates TCP state variables (sendbase,
timer etc)
(b) Duplicate ACK (ACK # < or = sendbase); it re-
ACKs old segments.

[email protected] Advanced Networking – Introduction 85


Sender Reaction To Duplicate ACKs
• Duplicate ACK (last ACK #) returned by
receiver if:
(a) segment received out of order (seq num larger than
expected)
(b) old segment received
• Sender ignores first two duplicate ACKs (timers
still in force)
• Upon receiving THIRD duplicate ACK, the
sender infers that the segment was indeed lost
(as opposed to delayed); sender retransmits
segment without waiting for timeout.

[email protected] Advanced Networking – Introduction 86


Flow/Congestion Control
• Flow Control (strict definition): regulate TCP
flow so as to prevent receive buffer overflow
at destination
• Flow Control (more general definition):
regulate TCP flow so as to prevent buffer
overflow anywhere along the path
• Congestion Control: regulate TCP flow(s) so as
to avoid congestion in the entire network and
to achieve efficient, fair sharing of resources.
• Key TCP flow/congestion mechanism:
adjustable sender window

[email protected] Advanced Networking – Introduction 87


TCP Connection Management
• TCP connection is set up using the three way handshake
protocol
• Special segments (SYN segment, SYNACK segment)
exchange initial client and server sequence numbers and
allocate buffers
• Three Way Handshake protocol allows to detect and
eliminate “old” connection requests (more robust than
two separate handshakes)
• Another Three Way Handshake (with FIN flag turned
on) is used to close the connection, releasing all
resources

[email protected] Advanced Networking – Introduction 88


Three Way Handshake

[email protected] Advanced Networking – Introduction 89


TCP Connection States (Client)

[email protected] Advanced Networking – Introduction 90


TCP Connection States (Server)

[email protected] Advanced Networking – Introduction 91

You might also like