TSIN02 - Internetworking
© 2004 Image Coding Group, Linköpings Universitet
Lecture 2: The Internet Protocol
Literature:● Forouzan: ch 4-9 and ch 27
TSIN02 - Internetworking
2
Outline
● About the network layer– Tasks– Addressing– Routing
● Protocols
TSIN02 - Internetworking
3
Tasks of the network layer● Source to destination delivery of packets (across
multiple networks)● Logical addressing - addresses valid over network
borders● Routing● Fragmentation and reassembly
TSIN02 - Internetworking
4
Logical vs Physical Addresses
● Each network interface card (NIC) has a physical address, eg MAC addresses. They are enough within a LAN, but give no routing help outside the local area.
● Logical addresses were created to help with communication between networks. Nodes within a LAN have neighbouring IP addresses. All traffic to the network can be routed using the common part of the addresses in the LAN, the network address.
TSIN02 - Internetworking
5
Addressing● 32 bit addresses in IPv4 -->approx 4300 million
addresses available.● Dotted decimal notation, eg. 198.36.42.18● Sometimes hexadecimal notation is used, eg
0xC6242A12
TSIN02 - Internetworking
6
Multihomed Devices
TSIN02 - Internetworking
7
Classful Addressing● Addresses are assigned in blocks where the block
size is defined by the chosen class.● Classes A-E. The first byte defines the class.
Note! This is an obsolete addressing scheme! (They are still in use though...)
● Many organisations have been assigned more addresses than they need!
● One reason we are running out of addresses!
TSIN02 - Internetworking
8
Classful addressing
Figures from Forouzan
TSIN02 - Internetworking
9
NetID and HostID
TSIN02 - Internetworking
10
Addresses and netmasks
● The network address is the first address in a block.
● The broadcast address is the last address in a block.
● A network mask is a 32 bit number such that the network address can be found by applying (bitwise, logical AND) the mask to any address in the block.
TSIN02 - Internetworking
11
Using more addresses
Several techniques have been developed to lower the number of wasted addresses, eg.:
● Subnetting - divide a block into subnets using netmasks.
● Supernetting - combine blocks into supernets using netmasks.
● Classless addressing - no classes● In all cases the number of nets must be a
power of 2
TSIN02 - Internetworking
12
With and without subnetting
Figure from Forouzan
TSIN02 - Internetworking
13
Subnetting example
A company is given the site address 201.70.64.0 (class C). The company needs
six subnets. Design the subnets!
TSIN02 - Internetworking
14
Example solution
● The number of 1s in the default mask is 24 (class C).
● The company needs six subnets. This is not a power of 2, so we will create eight subnets (8=23). We need three more 1s in the subnet mask, making it 27 in total
● The number of 0s is 32-27=5, so the mask is:11111111 11111111 11111111 11100000
or
255.255.255.224
TSIN02 - Internetworking
15
Example solution
Figure from Forouzan
TSIN02 - Internetworking
16
A Supernetwork
Figure from Forouzan
TSIN02 - Internetworking
17
Supernet example
● We made a supernetwork out of 4 class C blocks. What is the supernet mask?– We are using 4 blocks. For 4 blocks we need to
change two 1s to 0s in the default mask. So the mask is:
11111111 11111111 11111100 00000000
or
255.255.252.0
TSIN02 - Internetworking
18
Classless Addressing● Addresses are assigned in blocks of variable size.
One restriction is that the size of the block should be a power of 2.
● Slash notation - short form of network mask
– A.B.C.D/n where n is the number of 1s in the network mask.
TSIN02 - Internetworking
19
Delivery and Routing● Direct or indirect delivery● Connection-oriented or connectionless service● Routing tables - gets huge
– next-hop– network specific– default routing– static or dynamic
TSIN02 - Internetworking
20
Direct vs Indirect delivery
Figure from Forouzan
TSIN02 - Internetworking
21
Next-hop routing
Figure from Forouzan
TSIN02 - Internetworking
22
Network Specific Routing
Figure from Forouzan
TSIN02 - Internetworking
23
Default Routing
Figure from Forouzan
TSIN02 - Internetworking
24
Static or Dynamic Routing
● Static routing– routing table is entered manually
● Dynamic routing– routing table is periodically updated using a
dynamic routing protocol, like RIP, OSPF or BGP.
TSIN02 - Internetworking
25
Protocols
Figure from Forouzan
TSIN02 - Internetworking
26
ARP● Maps logical addresses to physical addresses. ● ARP requests are broadcasts on the LAN.● An ARP packet is encapsulated directly into a data
link frame.
Figure from Forouzan
TSIN02 - Internetworking
27
ARP Communication
Figure from Forouzan
TSIN02 - Internetworking
28
Proxy ARP
Figure from Forouzan
TSIN02 - Internetworking
29
RARP● Maps physical addresses to logical addresses.● RARP requests are broadcast on the LAN● A RARP packet is encapsulated directly into a data
link frame● There are newer and better alternatives to RARP
– BOOTP– DHCP
Figure from Forouzan
TSIN02 - Internetworking
30
RARP Communication
Figure from Forouzan
TSIN02 - Internetworking
31
The Internet Protocol (IP)
● Unreliable● Connectionless● A “best effort” delivery service
TSIN02 - Internetworking
32
Datagram
Figure from Forouzan
TSIN02 - Internetworking
33
Fragmentation
● Maximum transfer unit (MTU)● Each data link layer protocol use its own frame format. ● Fragmentation needed when passing to a network
with a smaller MTU (IPv4).
MTU examples:
Hyperchannel - 65535 bytesEthernet - 1500 bytesPPP - 296 bytes
TSIN02 - Internetworking
34
Options
Options are used for testing and debugging purposes
Figure from Forouzan
TSIN02 - Internetworking
35
Checksum
Redundant information added that is used for error detection
The checksum is constructed as follows:
1. Divide the packet into k sections, each of n bits
2. All sections are added together using one's complement arithmetic. (We will look at this during Class 1)
3. The result is complemented to make the checksum
TSIN02 - Internetworking
36
ICMP● Messages are encapsulated in IP datagrams.
● Two types of messages:
– Error reporting
● Dest. unreachable
● Source quench
● Time exceeded
● Parameter problems
● Redirection
– Query
● Echo request and reply
● Timestamp request and reply
● Address-mask request and reply
● Router solicitation and advertisement
Figure from Forouzan
TSIN02 - Internetworking
37
IPv6
● Addressing● Packet format● Extension headers● Difference from IPv4● Transition from IPv4 to IPv6
TSIN02 - Internetworking
38
IPv6: Addressing
There is a new addressing system in IPv6:– 128 bit addresses– new notation (hexadecimal colon notation)
eg. FDEC:BA33:0000:0000:FFCD:03F1:0000:0001( or FDEC:BA33::FFCD:3F1:0:1)
– slash notation supported– Three types of addresses
– unicast– anycast– multicast
– Address structure Type Prefix Rest of address
128 bits
variable
Figure from Forouzan
TSIN02 - Internetworking
39
Address Space Assignments
Type Prefix Type Fraction0000 0000 Reserved 1/256010 Provider based addresses 1/2561111 1110 10 Link local addresses 1/10241111 1110 11 Site local addresses 1/10241111 1111 Multicast addresses 1/256
●Unspecified●Loopback●IPv4
●Type 3 bits●Registry id 5bits●Provider id 16 bits●Subscriber id 24 bits●Subnet id 32 bits●Node id 48 bits
TSIN02 - Internetworking
40
IPv6 Datagram
Figure from Forouzan
TSIN02 - Internetworking
41
Datagram format
Figure from Forouzan
TSIN02 - Internetworking
42
Extension headers (options)– Hop-by-hop option
● Pad1● PadN● Jumbo payload
– Source routing– Fragmentation– Authentication– Encrypted Security Payload– Destination Option– (No Next Header)
TSIN02 - Internetworking
43
Extension Header Format
Figure from Forouzan
TSIN02 - Internetworking
44
Difference from IPv4
● (Much) larger address space● Better header format● New options● Prepared for extensions● Support for resource allocation (flow label)● Support for more security
TSIN02 - Internetworking
45
Transition Strategies
● Dual stack - hosts keep a dual stack of protocols, thus running IPv4 and IPv6 simultaneously.
● Tunneling - passing IPv6 packets through a region where IPv4 is used.– Automatic– Configured
● Header translation - when only a few hosts use IPv4
TSIN02 - Internetworking
46
ICMPv6
● Message format● Difference from ICMPv4
TSIN02 - Internetworking
47
What's new?● ARP and IGMP included in ICMPv6
● RARP dropped
● Error report● Source quench report dropped● Packet too big report added
IP
ICMPIGMP
ARP RARP
IP
ICMP
Network layer in version 4 Network layer in version 6
- Query- Timestamp query dropped- Address mask query dropped
Figures from Forouzan
TSIN02 - Internetworking
48
ICMPv6 message format
Figure from Forouzan
TSIN02 - Internetworking
49
ICMPv6 Error Messages
● Destination Unreachable● Packet Too Big● Time Exceeded● Parameter Problem