Download Congestion Control

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

AppleTalk wikipedia , lookup

Net neutrality law wikipedia , lookup

IEEE 802.1aq wikipedia , lookup

Peering wikipedia , lookup

Distributed firewall wikipedia , lookup

IEEE 1355 wikipedia , lookup

Multiprotocol Label Switching wikipedia , lookup

Network tap wikipedia , lookup

Net bias wikipedia , lookup

Deep packet inspection wikipedia , lookup

Asynchronous Transfer Mode wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Computer network wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

Airborne Networking wikipedia , lookup

Internet protocol suite wikipedia , lookup

UniPro protocol stack wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Routing in delay-tolerant networking wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Transcript
Lecture 11:
The Network Layer
ITCS 6166/8166 091
Spring 2007
Jamie Payton
Department of Computer Science
University of North Carolina at Charlotte
February 14, 2007
Slides adapted from:
Congestion slides for Computer Networks: A Systems Approach (Peterson and Davis)
Chapter 3 slides for Computer Networking: A Top Down Approach Featuring the Internet (Kurose and Ross)
1
Announcements
• Homework 2
– Due: Feb. 16 at 5 pm
– Submit through WebCT
• Homework 3
– Available!
– Due: Feb. 21
2
Homework 3 Helpful Tips
• TCP timeout
– Doubles after a packet loss
• Simple form of congestion control
• TCP congestion window
– At the conceptual level
• Doubles each RTT
– In implementation
• Window size increases by 1 MSS for every ACK
3
The Network Layer
• Function of network layer
– Provide end-to-end
connectivity
• Addressing
• Forwarding and Routing
• Two network types
– Connection-oriented
• Virtual circuit networks
– Connectionless
• Datagram networks
4
Network Layer Overview:
Forwarding and Routing
• Forwarding: move
packets from router’s
input to appropriate
router output
• Routing: determine
route taken by packets
from source to dest.
analogy:
• routing: process of
planning trip from
source to destination
• forwarding: process of
getting through single
interchange
– routing algorithms
5
Network Layer Overview:
Forwarding and Routing
routing algorithm
local forwarding table
header value output link
0100
0101
0111
1001
3
2
2
1
value in arriving
packet’s header
0111
1
3 2
6
Network Layer Overview:
Network Service Models
• Network service model defines
characteristics of end-to-end transport
Example services for individual
datagrams:
• guaranteed delivery
• guaranteed delivery with less
than 40 msec delay
Example services for a flow of
datagrams:
• in-order datagram delivery
• guaranteed minimum
bandwidth to flow
• restrictions on changes in
inter-packet spacing
7
Network Layer Overview:
Network Layer Service Models
Network
Architecture
Internet
Service
Model
Guarantees ?
Congestion
Bandwidth Loss Order Timing feedback
best effort none
ATM
CBR
ATM
VBR
ATM
ABR
ATM
UBR
constant
rate
guaranteed
rate
guaranteed
minimum
none
no
no
no
yes
yes
yes
yes
yes
yes
no
yes
no
no (inferred
via loss)
no
congestion
no
congestion
yes
no
yes
no
no
8
Network Layer Overview:
Connections
• Have two types of networks
– Connection-oriented
– Connectionless
• Similar to services in transport layer, but
– service: host-to-host
– no choice: network provides one
or the other
– implementation: in network core
• Support different network service models
9
Virtual Circuit Networks
• Provide connection-oriented service through virtual
circuits (VC)
• Connection process
– Connection setup
– Data transfer
– Connection teardown
• Router maintains state for
every connection
• Possible services provided
– In-order packet delivery
– Guaranteed bandwidth
– Guaranteed maximum jitter
• Examples: ATM networks
10
VC Implementation
A VC consists of:
1.
2.
3.
•
•
path from source to
destination
VC numbers, one number for
each link along path
entries in forwarding tables in
routers along path
Packet belonging to VC
carries VC number
VC number can be changed
on each link.
–
New VC number comes from
forwarding table
11
VC Forwarding Table
VC number
22
12
1
Forwarding table in NW router:
Incoming interface
1
2
3
1
…
Incoming VC #
12
63
7
97
…
2
interface
number
Outgoing interface
3
1
2
3
…
32
3
Outgoing VC #
22
18
17
87
…
Routers maintain connection state information!
12
Datagram Networks
• Provide connectionless network-layer transport through
datagram networks
• Packets are sent independently of each other
– Each packet has full set of control information
• Sent using destination address
– Every switch needs to be able to handle any packet
• No need for per-connection state
• Services
– “Best-effort”
– Not in-order delivery
– No guarantees on bandwidth, jitter
• Used in the Internet!
13
Internet Network Layer
• Relies on:
– Internet Protocol (IP)
• Data format and transfer
– Internet Control
Message Protocol (ICMP)
• Error handling
– Routing protocols
• Determines forwarding
tables
Network Layer
14
IP Protocol
• IP packet format
– 20 byte header
– + options
– + data
• IP header
– Version
– Source and destination
addresses
– Length
– Upper layer protocol
– Time-to-live (TTL)
– Header checksum
– Fields for “fragmentation”
15
IP Fragmentation & Reassembly
• Network links have MTU
(max. transfer size)
– largest possible link-level
frame
– different link types,
different MTUs
• Large IP datagram is
“fragmented”
– one datagram becomes
several datagrams
– “reassembled” at final
destination
– IP header bits used to
identify, order related
fragments
fragmentation:
in: one large datagram
out: 3 smaller datagrams
reassembly
16
IP Fragmentation and Reassembly
Example
• 4000 byte
datagram
• MTU = 1500
bytes
1480 bytes in
data field
offset =
1480/8
length ID fragflag
=4000 =x
=0
offset
=0
One large datagram becomes
several smaller datagrams
length ID fragflag
=1500 =x
=1
offset
=0
length ID fragflag
=1500 =x
=1
offset
=185
length ID fragflag
=1040 =x
=0
offset
=370
17
Overview of IP Addressing
• A 32-bit globally unique identifier for an interface
– Typically written in dotted-decimal notation:
192.168.0.1
• IP address assignment
– In blocks of neighboring IP addresses: “subnets”
– Notation: lowest address / prefix: 192.168.0.128/25
• Allocation of addresses is crucial for routing
18
IP Addressing
• IP address: 32-bit
identifier for host,
router interface
• interface: connection
between host/router
and physical link
223.1.1.1
223.1.2.1
223.1.1.2
223.1.1.4
223.1.1.3
223.1.2.9
223.1.3.27
223.1.2.2
– routers typically have
223.1.3.2
223.1.3.1
multiple interfaces
– host typically has one
interface
– IP addresses associated
223.1.1.1 = 11011111 00000001 00000001 00000001
with each interface
223
1
1
1
19
Subnets
• IP address:
– subnet part (high
order bits)
– host part (low order
bits)
223.1.1.1
223.1.2.1
223.1.1.2
223.1.1.4
223.1.1.3
223.1.3.27
223.1.2.2
subnet
• What’s a subnet ?
– device interfaces
with same subnet
part of IP address
– can physically reach
each other without
intervening router
223.1.2.9
223.1.3.1
223.1.3.2
network consisting of 3 subnets
20
Subnets
Recipe
• To determine the
subnets, detach
each interface from
its host or router,
creating islands of
isolated networks.
Each isolated
network is called a
subnet.
223.1.1.0/24
223.1.2.0/24
223.1.3.0/24
Subnet mask: /24
21
IP Addressing: CIDR
CIDR: 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
subnet
part
host
part
11001000 00010111 00010000 00000000
200.23.16.0/23
22
IP Addresses:
How to Get One?
Q: How does host get IP address?
• hard-coded by system admin in a file
– Wintel: control-panel->network->configuration>tcp/ip->properties
– UNIX: /etc/rc.config
• DHCP: Dynamic Host Configuration Protocol:
dynamically get address from as server
– “plug-and-play”
(more in next chapter)
23
IP Addresses:
How to Get One?
Q: How does network get subnet part of IP
addr?
A: gets allocated portion of its provider
ISP’s address space
ISP's block
11001000 00010111 00010000 00000000
200.23.16.0/20
Organization 0
Organization 1
Organization 2
...
11001000 00010111 00010000 00000000
11001000 00010111 00010010 00000000
11001000 00010111 00010100 00000000
…..
….
200.23.16.0/23
200.23.18.0/23
200.23.20.0/23
….
Organization 7
11001000 00010111 00011110 00000000
200.23.30.0/23
24
Hierarchical Addressing:
Route Aggregation
Hierarchical addressing allows efficient advertisement of routing
information:
Organization 0
200.23.16.0/23
Organization 1
200.23.18.0/23
Organization 2
200.23.20.0/23
Organization 7
.
.
.
.
.
.
Fly-By-Night-ISP
“Send me anything
with addresses
beginning
200.23.16.0/20”
Internet
200.23.30.0/23
ISPs-R-Us
“Send me anything
with addresses
beginning
199.31.0.0/16”
25
Hierarchical Addressing
ISPs-R-Us has a more specific route to Organization 1
Organization 0
200.23.16.0/23
Organization 2
200.23.20.0/23
Organization 7
.
.
.
.
.
.
Fly-By-Night-ISP
“Send me anything
with addresses
beginning
200.23.16.0/20”
Internet
200.23.30.0/23
ISPs-R-Us
Organization 1
200.23.18.0/23
“Send me anything
with addresses
beginning 199.31.0.0/16
or 200.23.18.0/23”
26
IP Addressing
Q: How does an ISP get block of
addresses?
A: ICANN: Internet Corporation for Assigned
Names and Numbers
– allocates addresses
– manages DNS
– assigns domain names, resolves disputes
27
Network Address Translation (NAT)
• Limited number of IP addresses
– Block of addresses reserved for “local” use
– 10.*.*.* and 192.168.*.*
• Network address translator
– Connects local net through single outside IP address
28
NAT: Network Address Translation
2: NAT router
changes datagram
source addr from
10.0.0.1, 3345 to
138.76.29.7, 5001,
updates table
2
NAT translation table
WAN side addr
LAN side addr
1: host 10.0.0.1
sends datagram to
128.119.40.186, 80
138.76.29.7, 5001 10.0.0.1, 3345
……
……
S: 10.0.0.1, 3345
D: 128.119.40.186, 80
S: 138.76.29.7, 5001
D: 128.119.40.186, 80
138.76.29.7
S: 128.119.40.186, 80
D: 138.76.29.7, 5001
3: Reply arrives
dest. address:
138.76.29.7, 5001
3
1
10.0.0.4
S: 128.119.40.186, 80
D: 10.0.0.1, 3345
10.0.0.1
10.0.0.2
4
10.0.0.3
4: NAT router
changes datagram
dest addr from
138.76.29.7, 5001 to 10.0.0.1, 3345
29
Internet Network Layer
• Relies on:
– Internet Protocol (IP)
• Data transfer
– Internet Control
Message Protocol (ICMP)
• Error handling
– Routing protocols
• Determines forwarding
tables
Network Layer
30
ICMP: Internet Control Message
Protocol
• Used by hosts & routers to communicate network-level information
– Error reporting
•
•
•
•
Unreachable host
Unreachable Network
Unreachable Port
Unknown Protocol
– Echo request/reply
• Used by ping
• Network-layer “above” IP:
– ICMP msgs carried in IP datagrams
• ICMP message:
– Type
– Code
– First 8 bytes of IP datagram causing error
31
ICMP Messages
Type
0
3
3
3
3
3
3
4
Code
0
0
1
2
3
6
7
0
8
9
10
11
12
0
0
0
0
0
description
echo reply (ping)
dest. network unreachable
dest host unreachable
dest protocol unreachable
dest port unreachable
dest network unknown
dest host unknown
source quench (congestion
control - not used)
echo request (ping)
route advertisement
router discovery
TTL expired
bad IP header
32
Internet Network Layer
• Relies on:
– Internet Protocol (IP)
• Data transfer
– Internet Control
Message Protocol (ICMP)
• Error handling
– Routing protocols
• Determines forwarding
tables
Network Layer
33
Summary
• Network Layer
– Connection versus connectionless
• Virtual Circuits vs. Datagram Networks
– Network Layer Functions
• Addressing
• Next time: Forwarding and Routing
34