transport layer3-1 summary: tcp congestion control when congwin is below threshold, sender in...
Post on 17-Jan-2018
228 Views
Preview:
DESCRIPTION
TRANSCRIPT
Transport Layer 3-1
Summary: TCP Congestion Control When CongWin is below Threshold, sender in slow-start phase,
window grows exponentially. When CongWin is above Threshold, sender is in congestion-
avoidance phase, window grows linearly. When a triple duplicate ACK occurs, Threshold set to CongWin/2
and CongWin set to Threshold. When timeout occurs, Threshold set to CongWin/2 and CongWin is
set to 1 MSS.
Transport Layer 3-2
Fairness goal: if K TCP sessions share same bottleneck link of bandwidth R, each should have average rate of R/K
TCP connection 1
bottleneckroutercapacity R
TCP connection 2
TCP Fairness
Transport Layer 3-3
Why is TCP fair?Two competing sessions: Additive increase gives slope of 1, as throughout increases multiplicative decrease decreases throughput proportionally
R
R
equal bandwidth share
Connection 1 throughputConn
e ctio
n 2
thro
u ghp
ut
congestion avoidance: additive increase
loss: decrease window by factor of 2congestion avoidance: additive increaseloss: decrease window by factor of 2
Transport Layer 3-4
Fairness (more)Fairness and UDP Multimedia apps
often do not use TCP do not want rate
throttled by congestion control
Instead use UDP: pump audio/video at
constant rate, tolerate packet loss
Research area: TCP friendly
Fairness and parallel TCP connections
nothing prevents app from opening parallel connections between 2 hosts.
Web browsers do this Example: link of rate R
supporting 9 connections; new app asks for 1 TCP,
gets rate R/10 new app asks for 11 TCPs,
gets R/2 !
Network Layer 4-5
Chapter 4Network Layer
A note on the use of these ppt slides:We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: If you use these slides (e.g., in a class) in substantially unaltered form,
that you mention their source (after all, we’d like people to use our book!) If you post any slides in substantially unaltered form on a www site, that
you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material.
Thanks and enjoy! JFK/KWR
All material copyright 1996-2009J.F Kurose and K.W. Ross, All Rights Reserved
Computer Networking: A Top Down Approach 5th edition. Jim Kurose, Keith RossAddison-Wesley, April 2009.
Network Layer
Review: TCP Reliable data transfer: acks Pipelined protocol: in-flight packets Cumulated acks (single timer) Flow control (receiver window size) Congestion control (congestion window
size): AIMD TCP's two phase operations: Slow Start
+ Congestion Control
4-6
Network Layer 4-7
Chapter 4: Network LayerChapter goals: understand principles behind network
layer services: IP addresses (+ getting an IP address via
DHCP) Routing algorithms Network of networks (BGP, dealing with
scales) ICMP NAT (network address translation)
Network Layer 4-8
Datagram networks no call setup at network layer routers: no state about end-to-end connections
no network-level concept of “connection” packets forwarded using destination host
address packets between same source-dest pair may take
different paths
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
1. Send data 2. Receive data
Network Layer 4-9
The Internet Network layer
forwardingtable
Host, router network layer functions:
Routing protocols• path selection• RIP, OSPF, BGP
IP protocol• addressing conventions• datagram format• packet handling conventions
ICMP protocol• error reporting• router
“signaling”
Transport layer: TCP, UDP
Link layer
physical layer
Networklayer
IP datagram format
ver length
32 bits
data (variable length,typically a TCP
or UDP segment)
16-bit identifierheader
checksumtime to
live
32 bit source IP address
IP protocol versionnumber
header length (bytes)
max numberremaining hops
(decremented at each router)
forfragmentation/reassembly
total datagramlength (bytes)
upper layer protocolto deliver payload to
head.len
type ofservice
“type” of data flgs fragment offset
upper layer
32 bit destination IP address
Options (if any) E.g. timestamp,record routetaken, specifylist of routers to visit.
how much overhead with TCP?
20 bytes of TCP 20 bytes of IP = 40 bytes +
app layer overhead
TCP/UDPIP
Ethernet
Application
Network Layer 4-11
IP Fragmentation and Reassembly
network links have MTU (max.transfer size) - largest possible link-level frame. different link types,
different MTUs large IP datagram divided
(“fragmented”) within net one datagram becomes
several datagrams “reassembled” only at
final destination IP header bits used to
identify, order related fragments
fragmentation: in: one large datagramout: 3 smaller datagrams
reassembly
Network Layer 4-12
IP Addressing IP address: 32-bit
identifier for host, router interface
interface: connection between host/router and physical link router’s typically
have multiple interfaces
host typically has one interface
IP addresses associated with each interface
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
223.1.1.1 = 11011111 00000001 00000001 00000001
223 1 11
interface
Network Layer 4-13
Subnets IP address:
subnet part (high order bits)
host part (low order bits)
What’s a subnet ? device interfaces
with same subnet part of IP address
can physically reach each other without intervening router
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
network consisting of 3 subnets
subnet
Network Layer 4-14
IP addressing: CIDRCIDR: Classless InterDomain Routing
subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in
subnet portion of address
11001000 00010111 00010000 00000000
subnetpart
hostpart
200.23.16.0/23
Network Layer 4-15
IP addresses: how to get one?
Q: How does a host get IP address?
hard-coded by system admin in a file Windows: control-panel->network-
>configuration->tcp/ip->properties Linux (ubuntu): /etc/network/interface
DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server “plug-and-play”
Network Layer 4-16
DHCP: Dynamic Host Configuration Protocol
Goal: allow host to dynamically obtain its IP address from network server when it joins networkCan renew its lease on address in useAllows reuse of addresses (only hold address while
connected an “on”)Support for mobile users who want to join network (more
shortly)DHCP overview:
1. host broadcasts “DHCP discover” msg2. DHCP server responds with “DHCP offer”
msg3. host requests IP address: “DHCP request”
msg4. DHCP server sends address: “DHCP ack”
msg
Network Layer 4-17
Graph abstraction of a network
u
yx
wv
z2
21 3
1
12
53
5• c(x,x’) = cost of link (x,x’)
- e.g., c(w,z) = 5
• cost could always be 1, or inversely related to bandwidth,or inversely related to congestion
Cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp)
Question: What’s the least-cost path between u and z ?
Routing algorithm: algorithm that finds least-cost path
Graph: G = (N,E)N = set of routers = { u, v, w, x, y, z }
E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
Network Layer 4-18
Routing algorithmsGlobal or decentralized
information?
Global: all routers have complete
topology, link cost info “link state” algorithms (OSPF)
Decentralized: router knows physically-
connected neighbors, link costs to neighbors
iterative process of computation, exchange of info with neighbors
“distance vector” algorithms (RIP)
Static or dynamic?
Static: routes change slowly
over time
Dynamic: routes change more
quickly periodic update in response to link
cost changes
Network Layer 4-19
1
23
0111
value in arrivingpacket’s header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing, forwarding
Network Layer 4-20
Hierarchical routing for scalability
scale: with 200 million destinations:
can’t store all dest’s in routing tables!
routing table exchange would swamp links!
administrative autonomy
internet = network of networks
each network admin may want to control routing in its own network
Our routing study thus far - idealization all routers identical network “flat”… not true in practice
Network Layer 4-21
Hierarchical addressing: route aggregation
“Send me anythingwith addresses
beginning 200.23.16.0/20”
200.23.16.0/23
200.23.18.0/23
200.23.30.0/23
Fly-By-Night-ISP
Organization 0
Organization 7Internet
Organization 1
ISPs-R-Us “Send me anythingwith addresses
beginning 199.31.0.0/16”
200.23.20.0/23Organization 2
...
...
Hierarchical addressing allows efficient advertisement of routing information:
Network Layer 4-22
Hierarchical addressing: more specific routesISPs-R-Us has a more specific route to Organization 1
“Send me anythingwith addresses beginning 200.23.16.0/20”
200.23.16.0/23
200.23.18.0/23
200.23.30.0/23
Fly-By-Night-ISP
Organization 0
Organization 7Internet
Organization 1
ISPs-R-Us “Send me anythingwith addresses beginning 199.31.0.0/16or 200.23.18.0/23”
200.23.20.0/23Organization 2
...
...
Network Layer 4-23
Hierarchical routing for scalability aggregate routers
into regions, “autonomous systems” (AS)
routers in same AS run same routing protocol “intra-AS” routing
protocol routers in different AS
can run different intra-AS routing protocol
Gateway router Direct link to router in another AS
Network Layer 4-24
3b
1d
3a1c
2aAS3
AS1AS21a
2c2b
1b
Intra-ASRouting algorithm
Inter-ASRouting algorithm
Forwardingtable
3c
Interconnected ASs
forwarding table configured by both intra- and inter-AS routing algorithm intra-AS sets entries
for internal dests inter-AS & intra-AS
sets entries for external dests
Network Layer 4-25
Internet inter-AS routing: BGP BGP (Border Gateway Protocol):
the de facto standard BGP provides each AS a means to:
1. Obtain subnet reachability information from neighboring ASs.
2. Propagate reachability information to all AS-internal routers.
3. Determine “good” routes to subnets based on reachability information and policy.
allows subnet to advertise its existence to rest of Internet: “I am here”
Network Layer 4-26
BGP basics pairs of routers (BGP peers) exchange routing
info over TCP connections (called BGP sessions) BGP sessions need not correspond to
physical links. when AS2 advertises prefix “200.23.16.0/23” to
AS1: AS2 promises it will forward datagrams
towards that prefix. AS2 can aggregate prefixes in its
advertisement
3b
1d
3a1c
2aAS3
AS1
AS21a
2c2b
1b
3ceBGP sessioniBGP session
Network Layer 4-27
Distributing reachability info using eBGP session between 3a and 1c, AS3
sends prefix reachability info to AS1. 1c can then use iBGP do distribute new
prefix info to all routers in AS1 1b can then re-advertise new reachability
info to AS2 over 1b-to-2a eBGP session when router learns of new prefix, it creates
entry for prefix in its forwarding table.
3b
1d
3a1c
2aAS3
AS1
AS21a
2c2b
1b
3ceBGP sessioniBGP session
Any dest w/ IP addr AS1should be
routed to 1c
Any dest w/ IP addr AS1should be
routed to 2a
Network Layer 4-28
Path attributes & BGP routes advertised prefix includes BGP attributes.
prefix + attributes = “route” two important attributes:
AS-PATH: contains ASs through which prefix advertisement has passed: e.g, AS 67, AS 17
NEXT-HOP: indicates specific internal-AS router to next-hop AS. (may be multiple links from current AS to next-hop-AS)
when gateway router receives route advertisement, uses local import policy to accept/decline.
Network Layer 4-29
BGP route selection router may learn about more than 1
route to some prefix. Router must select route.
elimination rules:1. local preference value attribute: policy
decision2. shortest AS-PATH 3. closest NEXT-HOP router: hot potato
routing4. additional criteria
Network Layer 4-30
Why different Intra- and Inter-AS routing ? Policy: Inter-AS: admin wants control over how its traffic
routed, who routes through its net. Intra-AS: single admin, so no policy decisions
neededScale: hierarchical routing saves table size, reduced
update trafficPerformance: Intra-AS: can focus on performance Inter-AS: policy may dominate over performance
Network Layer 4-31
NAT: Network Address Translation Motivation: local network uses just one IP address
as far as outside world is concerned: range of addresses not needed from ISP: just one
IP address for all devices can change addresses of devices in local network
without notifying outside world can change ISP without changing addresses of
devices in local network devices inside local net not explicitly
addressable, visible by outside world (a security plus).
Network Layer 4-32
NAT: Network Address Translation
10.0.0.1
10.0.0.2
10.0.0.3
10.0.0.4
138.76.29.7
local network(e.g., home network)
10.0.0/24
rest ofInternet
Datagrams with source or destination in this networkhave 10.0.0/24 address for
source, destination (as usual)
All datagrams leaving localnetwork have same single source
NAT IP address: 138.76.29.7,different source port numbers
Network Layer 4-33
NAT: Network Address Translation
10.0.0.1
10.0.0.2
10.0.0.3
S: 10.0.0.1, 3345D: 128.119.40.186, 80
110.0.0.4
138.76.29.7
1: host 10.0.0.1 sends datagram to 128.119.40.186, 80
NAT translation tableWAN side addr LAN side addr138.76.29.7, 5001 10.0.0.1, 3345…… ……
S: 128.119.40.186, 80 D: 10.0.0.1, 3345
4
S: 138.76.29.7, 5001D: 128.119.40.186, 80
2
2: NAT routerchanges datagramsource addr from10.0.0.1, 3345 to138.76.29.7, 5001,updates table
S: 128.119.40.186, 80 D: 138.76.29.7, 5001
33: Reply arrives dest. address: 138.76.29.7, 5001
4: NAT routerchanges datagramdest addr from138.76.29.7, 5001 to 10.0.0.1, 3345
Network Layer 4-34
NAT: Network Address Translation
16-bit port-number field: 60,000 simultaneous connections with a
single LAN-side address! NAT is controversial:
routers should only process up to layer 3 violates end-to-end argument
• NAT possibility must be taken into account by app designers, eg, P2P applications
address shortage should instead be solved by IPv6
Network Layer 4-35
NAT traversal problem client wants to connect to
server with address 10.0.0.1 server address 10.0.0.1
local to LAN (client can’t use it as destination addr)
only one externally visible NATted address: 138.76.29.7
solution 1: statically configure NAT to forward incoming connection requests at given port to server e.g., (123.76.29.7, port
2500) always forwarded to 10.0.0.1 port 25000
10.0.0.1
10.0.0.4
NAT router
138.76.29.7
Client ?
Network Layer 4-36
NAT traversal problem solution 2: Universal Plug
and Play (UPnP) Internet Gateway Device (IGD) Protocol. Allows NATted host to: learn public IP address
(138.76.29.7) add/remove port
mappings (with lease times)
i.e., automate static NAT port map configuration
10.0.0.1
10.0.0.4
NAT router
138.76.29.7
IGD
Network Layer 4-37
NAT traversal problem solution 3: relaying (used in Skype)
NATed client establishes connection to relay External client connects to relay relay bridges packets between to
connections
138.76.29.7Client
10.0.0.1
NAT router
1. connection torelay initiatedby NATted host
2. connection torelay initiatedby client 3. relaying
established
Network Layer 4-38
top related