Lecture
Lecture
Ante Prodan
School of Computer, Data and
Mathematical Sciences
1
Case study report
n Random groups assigned –
check your partner’s details
online:
n Select the topics and email to me,
otherwise I will select it for you by the
next week.
n LINK
n https://docs.google.com/spreadsheets/d/1xLEaKdUiS
5cQYGuZ6yDZJ5Oj-CBa533K/edit#gid=119324034
2
Important Concepts
n How Routers work – forwarding and Routing
n Network Layer Services
n Connection oriented and Connection less paths between hosts
n IP Packet Structure, IP fragmentation and reassembly
n IP Addresses, Class base and Classless
n Subnets and Subnet masks
n How Computer get an IP address – Static and DHCP
n Connecting a computer to a network – Gateway, Subnet mask
and DNS
n How Organisations get IP addresses
n NAT ; Network Address Translation
n ICMP – Internet Control Message Protocol – Traceroute and
ICMP
n IPv6 – 128 bit address space
3
Network layer
application
transport
network
n transport segments from data link
physical
sending to receiving host network
data link
network
data link
network
physical
on sending side
physical
data link
n physical network network
5
Interplay between routing and forwarding
routing algorithm
value in arriving
packet’s header
0111 1
3 2
6
Network service model
Q: What service model for “channel” transporting
datagrams from sender to receiver?
n guaranteed delivery
delivery
with less than 40 msec n guaranteed minimum
in inter-packet spacing
7
Network layer connection and
connection-less service
n datagram network provides network-
layer connectionless service
n VC network provides network-layer
connection service
n analogous to the transport-layer
services, but:
n service: host-to-host
n no choice: network provides one or the
other
n implementation: in network core 8
Virtual circuits (VC)
“source-to-dest path behaves much like telephone
circuit”
n performance-wise
n network actions along source-to-dest path
n call setup, teardown for each call before data can flow
n each packet carries VC identifier (not destination host address)
n every router on source-dest path maintains “state” for each
passing connection
n link, router resources (bandwidth, buffers) may be allocated to
VC (dedicated resources = predictable service)
9
Connection setup
n 3rd important function in some network
architectures:
n ATM, frame relay, X.25
11
Forwarding table
VC number
12 22 32
1 3
2
1 12 3 22
2 63 1 18
3 7 2 17
1 97 3 87
… … … …
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
13
Datagram networks
n no call setup at network layer
n routers: no state about end-to-end connections
n no network-level concept of “connection”
n packets forwarded using destination host address
n 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
14
https://etc.ch/XqKn
Question 1
What are the service model/s that network
layer can provide?
15
4 billion
Forwarding table possible entries
otherwise 3
16
Router Architecture Overview
17
Input Port Functions
Physical layer:
bit-level reception
Data link layer: Decentralized switching:
e.g., Ethernet n given datagram dest., lookup output port
see chapter 5 using forwarding table in input port
memory
n goal: complete input port processing at ‘line
speed’
n queuing: if datagrams arrive faster than
forwarding rate into switch fabric
18
Three types of switching fabrics
19
Output Ports
22
The Internet Network layer
Host, router network layer functions:
Link layer
physical layer
23
IP datagram format
25
IP Fragmentation and Reassembly
length ID fragflag offset
Example =4000 =x =0 =0
n MTU = 1500
length ID fragflag offset
bytes =1500 =x =1 =0
1480 bytes in
data field length ID fragflag offset
=1500 =x =1 =185
offset =
1480/8 length ID fragflag offset
=1040 =x =0 =370
26
IP Addressing: introduction
223.1.1.1
n IP address: 32-bit 223.1.2.1
identifier for host, 223.1.1.2
223.1.1.4 223.1.2.9
router interface
n interface: connection 223.1.1.3 223.1.3.27
223.1.2.2
between host/router
and physical link
n router’s typically have 223.1.3.1 223.1.3.2
multiple interfaces
n host typically has one
interface
n IP addresses associated 223.1.1.1 = 11011111 00000001 00000001 00000001
with each interface
223 1 1 1
27
Subnets
223.1.1.1
n IP address:
223.1.2.1
n subnet part (high order 223.1.1.2
bits) 223.1.1.4 223.1.2.9
n host part (low order
223.1.2.2
bits) 223.1.1.3 223.1.3.27
n What’s a subnet ? subnet
n device interfaces with
same subnet part of IP 223.1.3.1 223.1.3.2
address
n can physically reach
each other without network consisting of 3 subnets
intervening router
28
Subnets
223.1.1.0/24
223.1.2.0/24
Recipe
n To determine the
223.1.3.0/24
subnet host
part part
11001000 00010111 00010000 00000000
200.23.16.0/24
30
IP addresses: how to get one?
>configuration->tcp/ip->properties
n UNIX: /etc/rc.config
31
DHCP: Dynamic Host Configuration
Protocol
32
DHCP client-server scenario
33
DHCP client-server scenario
DHCP server: 223.1.2.5 arriving
DHCP discover
client
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
Lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
time Lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
34
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
35
Hierarchical addressing: route
aggregation
Hierarchical addressing allows efficient advertisement of routing
information:
Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
beginning
199.31.0.0/16”
36
Hierarchical addressing: more specific route
“Send me anything
with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
Organization 1 beginning 199.31.0.0/16
or 200.23.18.0/23”
200.23.18.0/23
37
NAT: Network Address Translation
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
38
NAT: Network Address Translation
in local network
n devices inside local net not explicitly addressable, visible
39
NAT: Network Address Translation
Implementation: NAT router must:
41
NAT: Network Address Translation
n 16-bit port-number field:
n 60,000 simultaneous connections with a
single LAN-side address!
n NAT is controversial:
n routers should only process up to layer 3
n violates end-to-end argument
n NAT possibility must be taken into account by
app designers, eg, P2P applications
n address shortage should instead be solved
by IPv6
42
ICMP: Internet Control Message Protocol
n used by hosts & routers to
communicate network-level Type Code description
information 0 0 echo reply (ping)
3 0 dest. network unreachable
n error reporting:
3 1 dest host unreachable
unreachable host, 3 2 dest protocol unreachable
network, port, protocol 3 3 dest port unreachable
n echo request/reply (used
3 6 dest network unknown
by ping) 3 7 dest host unknown
4 0 source quench (congestion
n network-layer “above” IP: control - not used)
n ICMP msgs carried in IP 8 0 echo request (ping)
datagrams 9 0 route advertisement
10 0 router discovery
n ICMP message: type, code
11 0 TTL expired
plus first 8 bytes of IP 12 0 bad IP header
datagram causing error
43
Traceroute and ICMP
n Source sends series of UDP n When ICMP message arrives,
segments to destination source calculates RTT
n First has TTL =1 n Traceroute does this 3 times
n Second has TTL=2, etc. Stopping criterion
n Unlikely port number n UDP segment eventually
n When n-th datagram arrives to arrives at destination host
n-th router: n Destination returns ICMP
n Router discards datagram “host unreachable” packet
n And sends to source an ICMP (type 3, code 3)
message (type 11, code 0)
n When source gets this ICMP,
Message includes name of
n
stops.
router& IP address
44
Question 3 https://etc.ch/XqKn
45
IPv6
n no fragmentation allowed
46
Other resources
n Internet (IP) layer of TCP/IP
n Wikipedia http://en.wikipedia.org/wiki/Internet_layer
n Video
http://www.youtube.com/watch?v=STvq52WOIiw
n DHCP (video)
n http://www.youtube.com/watch?v=bv1itFPQ7O0&list
=PL547999D71DCAB1D0
n ICMP (video)
n http://www.youtube.com/watch?v=iWX1-QKG-
8Q&list=PL547999D71DCAB1D0
47
Other resources
n An introduction to IPv6
n https://www.youtube.com/watch?v=qLpxn
Hk6q50
48