Internet Architecture
Physical networks interconnected by a router
Internetworking Principle
Interconnection of Packet Switching networks
use the services that the PS networks provide
adapt packet lengths to supported lengths (fragmentation)
Internet Protocols
global addresses
port numbers
protocol number
IP addresses
subnetwork addresses
Introduction of new
applications:
Router Network
End systems
have a network (IP) address assigned to each network interface
have neighbour router(s) configured (default route, configured
routes)
communicate within local network using Link Layer addresses
IP Protocol Functions
Connectionless, unreliable best-effort delivery of data
Datagram addressing and forwarding
IP header check
Segmentation and reassembly (fragmentation)
Error reporting (ICMP)
IP Packets
IP packet also called
datagram
HLE
N
10
11
Influence on queuing
may have influence on routing decision
can be coupled to lower layer service classes
policy framework needed for general use
12
13
residual hop
count
necessary to avoid infinitely circling packets in the case of a
routing loop
(special problem of connectionless packet switching!)
15
16
IP Address
IP address is use as an identifier in the IP layer of the TCP/
IP suite to identify devices/host connected in the network.
An IP address is a 32-bit address that is unique and
universal.
Address space: the total number of address used by the
protocol.
A protocol use N bits to define an address, the address
space is 2N because each bit can have two different
values; 0 or 1 and N bits can have 2N values.
IPv4 uses 32-bit addresses, which mean that address
space is
17
IP Address Parts
32 bit IP address is divided into Network ID and Host ID
IP Addresses
32bit IP address specifies
Zero means
this
One means
all
19
Operation of TCP/IP
20
21
Notation
Binary
Three
common
notation of
IP address
Dotted
Decimal
Hexadeci
mal
22
Binary Notation
In binary notation, the IP address is displayed as 32 bits.
One or more spaces are usually inserted between each
octet (8 bits).
Each octet is often referred to as a byte.
23
10000000
00001011
00000011
00011111
128 . 11 . 3 . 31
24
Hexadecimal Notation
Sometimes an IP address can be seen in hexadecimal
notation.
Each hexadecimal digit is equivalent to four bits. This
means that a 32-bit address has 8 hexadecimal digits.
Hexadecimal notation normally has no added spaces or
dots; however, 0X (or 0x) is added at the beginning or the
subscript 16 at the end to show that the number is in
hexadecimal.
100000001 00001011 00001011
11101111
0X 81 0B 0B EF
becomes
0X810B0BEF or 810B0BEF16
25
Example
Change the following IP address from binary notation to
dotted-decimal notation
Example
Change the following IP addresses from dotted-decimal
notation to binary notation
111. 56.45.78
01101111 00111000 00101101 01001110
221.34.7.82
11011101 00100010 00000111 01010010
241.8.56.12
11110001 00001000 00111000 00001100
75.45.34.78
01001011 00101101 00100010 01001110
27
IP Addresses - Class A
Start with binary 0
All 0 reserved
01111111 (127) reserved for loopback
Range 1.x.x.x to 126.x.x.x
All allocated
28
IP Addresses - Class B
Start with binary 10
Range 128.x.x.x to 191.x.x.x
Second octet also included in network address
214 = 16,384 class B addresses
All allocated
29
IP Addresses - Class C
Start with binary 110
Range 192.x.x.x to 223.x.x.x
Second and third octet also part of network address
221 = 2,097,152 addresses
Nearly all allocated
see IPv6
30
Class in IP addressing
First
byte
Second
byte
Third
byte
Fourth
byte
First
byte
Class A
Class A
0-127
Class B
10
Class B
128 -191
Class C
110
Class C
192
-223
Class D
1110
Class D
224
-239
Class E
1111
Class E
240
-255
a. Binary notation
Second
byte
Third
byte
Fourth
byte
31
Example
Find the class of each address
227.12.14.87
(between 224 239) Class D
193.14.56.22
(between 192 223) Class C
14.23.120.8
(between 0- 127) Class A
252.5.15.111
(between 240-255) Class E
134.11.78.56
(between 128- 191) Class B
32
33
Second
byte
Netid
Third
byte
Fourth
byte
Hostid
Netid
Hostid
Class C
Netid
Class D
Multicast address
Class E
Hostid
34
Classless IP address
Classful addressing, which is almost obsolete, is replaced
with classless addressing.
Addressing are in variable length blocks which assigned to
no class.
Example: block of 2 addresses, 4 addresses, 128 addresses
and so on.
Here, the entire address space (232 addresses) is divided
into blocks of different sizes
35
Classless IP address
Only one restriction on the number of addresses in a block;
it must be a power of two (2,4,8,16).
Household :a block of 2 (21) addresses.
A small business: a block of 16 (24) addresses.
A large organization : a block of 1024 (210) addresses.
36
Classless IP address
The first addresses must be evenly divisible by the number
of addresses.
if a block contains 4 addresses, the first address must be divisible
by 4.
If the block contains 16 addresses, the first addresses must be
divisible by 16.
If the block has 256 addresses or less, check only the right most
byte.
37
38
Mask
/n
Mask
/1
128.0.0.0
/9
255.128.0.0
/2
192.0.0.0
/10
/3
224.0.0.0
/4
/n
Mask
/n
Mask
/17
255.255.128.0
/25
255.255.255.128
255.192.0.0
/18
255.255.192.0
/26
255.255.255.192
/11
255.244.0.0
/19
255.255.224.0
/27
255.255.255.224
240.0.0.0
/12
255.240.0.0
/20
255.255.240.0
/28
255.255.255.240
/5
248.0.0.0
/13
255.248.0.0
/21
255.255.248.0
/29
255.255.255.248
/6
252.0.0.0
/14
255.252.0.0
/22
255.255.252.0
/30
255.255.255.252
/7
254.0.0.0
/15
255.254.0.0
/23
255.255.254.0
/31
255.255.255.254
/8
255.0.0.0
/16
255.255.0.0
/24
255.255.255.0
/32
255.255.255.255
39
40
41
Example1
Given IP address 167.199.170.82/27.
Find:
1) The first address in the block
2) The number of address in the block
3) The last address in the block.
42
167.199.170.64/27
43
Number of Address
Finding the number of of address in
the block is very simple.
The total number of addresses in the
block is
232-n = 232-27= 25 = 32
44
Last Address
F i n d t h e c o m p l e m e n t o f m a s k f o r I P a d d re s s
167.199.170.82/27.
The mask is 255.255.255.224 , 11111111
11111111
11111111 11100000.
The complement is 00000000
00000000
00000000
00011111. Add the first address to the mask complement
167.199.170.64
0 . 0 . 0 .31
_____________
167.199.170.95
45
Example 2
Given IP address 190.87.140.202/29
Find:
1) The first address in the block
2) The number of address in the block
3) The last address in the block
46
Solution:
We need 4 subnets, we need to add 2 more 1s because
log24=2 to the site prefix. The subnet prefix is then /28
47
1st subnet
/28
2nd
subnet
4th
subnet
/28
/28
3rd
subnet
/28
48
49
Exercise
The organization is granted the block 130.34.12.64/26. The
organization needs 8 subnets.
a) What is the prefix length?
b) How many address does each subnet can support?
c) Find the 1st and last add of the 1st subnet?
50
53
ICMP Messages
ICMP message format starts with a 64-bit header consisting
the following:
Type (8bits) field defines the type of ICMP message.
Code (8 bits) field specifies the reason for the particular
message type.
Checksum (16 bits) Checksum for the entire ICMP message.
This is the same checksum algorithm used in IP.
Parameters (32 bits) used to specify more lengthy parameters.
54
ICMP Messages
ICMP
Messages
Error reporting
Query
56
Reachability Test
Uses ICMP echo request and echo reply
Corresponding tool:
ping
57
Unreachable Destinations
Router cannot forward packet
destination host cannot accept packet
58
Route Change
Router are assumed to know a correct route to the
destination
Hosts have minimal routing information
can be started up knowing only one router
may learn additional information from routers
59
Subnet Mask
Used to request the local address mask from a router
broadcast if no router is known
60
Router Advertisement
Sent periodically by routers
soft state, i.e. state is only
kept for a given lifetime
61
Router Solicitation
Ask available routers to send an advertisement
immediately
Used by freshly booted hosts
Send to broadcast address (255.255.255.255)
Or to the all routers multicast address (224.0.0.2)
62
63
Example local
network
65
66
67
68
Bs MAC add
Bs IP add
As MAC add
As IP add
69
70
RARP Example
A is booted
Example local
network
71
Routing Principle
How to deliver a datagram?
To a destination on the local network:
send the datagram directly
use e.g. ARP to obtain corresponding hardware address
To other destinations:
send the datagram via routers
Example:
Host A directly
connected to B, C,
D, E, F, G, R1, R2
to network N1
o route via R1
to network N2
o route via R2
72
Routing Algorithm
Extract destination IP address IPD from datagram and
compute network prefix N
If N matches any directly connected network address
deliver datagram to destination IPD over that network
else
Forwarding a Datagram
Get next hop from routing table
Get hardware address for next hop (ARP / ARP cache)
Reduce Time To Live (usually by 1)
Recompute header checksum
Send datagram on local network to the next hops
hardware address
address fields in IP header are not modified! (exception:
source routing option fields)
74
Host
receives datagrams
sends out datagrams
according to routing table
to destination if local
to next hop router if non-local
can live with knowing just one
router
multi-homed host can have
multiple network addresses
Be careful when forwarding
packets (avoid routing loops)
75
Subnet Routing
Include subnet mask in routing table
Check if 32bit AND of destination address and network
mask in routing table entry is equal to network address in
routing table entry
Next hop still needs to be accessible on the local network
Beware of ambiguities!
Use consistent subnet masks across all networks within the
same subnetted IP network
Otherwise subnet broadcasting is ambiguous
76
Routing Algorithms
For a given topology, find out the shortest path to each
destination.
Challenges
avoid loops
react to failures
react to topology changes
discover topology
77
Routing Algorithms
Routing protocols
Intra domain
Inter domain
Distance vector
(i.e.RIP)
78
Routing Algorithms
Shortest Path
routing
Non adaptive
(static)
Flooding
Adaptive
(dynamic)
Distance vector
routing
(Bellman-ford)
Link state
Routing
79
80
Djikstra's Algorithm
Djikstra's algorithm solves the problem of finding the
shortest path from a point in a graph (the source) to a
destination.
One can find the shortest paths from a given source to all
points in a graph in the same time
This problem is sometimes called the single-source shortest
paths problem.
81
82
Routing Protocols
Routing protocols used to
discover routes
propagate route information
validate routes
check route consistency
83
AS Communications
Communication between different Autonomous Systems
exterior gateway protocols (EGP)
propagation of reachability information
routing metrics are not communicated or interpreted
internal structures are hidden
84
Protocol Overview
Exterior Gateway Protocols
Border Gateway Protocol (BGP), currently BGP-4
85