Lecture 2: The Internet Protocol · address, eg MAC addresses. They are enough within a LAN, but...

49
TSIN02 - Internetworking © 2004 Image Coding Group, Linköpings Universitet Lecture 2: The Internet Protocol Literature: Forouzan: ch 4-9 and ch 27

Transcript of Lecture 2: The Internet Protocol · address, eg MAC addresses. They are enough within a LAN, but...

Page 1: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

© 2004 Image Coding Group, Linköpings Universitet

Lecture 2: The Internet Protocol

Literature:● Forouzan: ch 4-9 and ch 27

Page 2: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

2

Outline

● About the network layer– Tasks– Addressing– Routing

● Protocols

Page 3: Lecture 2: The Internet Protocol · 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

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

Page 4: Lecture 2: The Internet Protocol · 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

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.

Page 5: Lecture 2: The Internet Protocol · 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

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

Page 6: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

6

Multihomed Devices

Page 7: Lecture 2: The Internet Protocol · 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

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!

Page 8: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

8

Classful addressing

Figures from Forouzan

Page 9: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

9

NetID and HostID

Page 10: Lecture 2: The Internet Protocol · 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

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.

Page 11: Lecture 2: The Internet Protocol · 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

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

Page 12: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

12

With and without subnetting

Figure from Forouzan

Page 13: Lecture 2: The Internet Protocol · 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

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!

Page 14: Lecture 2: The Internet Protocol · 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

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

Page 15: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

15

Example solution

Figure from Forouzan

Page 16: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

16

A Supernetwork

Figure from Forouzan

Page 17: Lecture 2: The Internet Protocol · 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

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

Page 18: Lecture 2: The Internet Protocol · 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

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.

Page 19: Lecture 2: The Internet Protocol · 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

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

Page 20: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

20

Direct vs Indirect delivery

Figure from Forouzan

Page 21: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

21

Next-hop routing

Figure from Forouzan

Page 22: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

22

Network Specific Routing

Figure from Forouzan

Page 23: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

23

Default Routing

Figure from Forouzan

Page 24: Lecture 2: The Internet Protocol · 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

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.

Page 25: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

25

Protocols

Figure from Forouzan

Page 26: Lecture 2: The Internet Protocol · 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

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

Page 27: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

27

ARP Communication

Figure from Forouzan

Page 28: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

28

Proxy ARP

Figure from Forouzan

Page 29: Lecture 2: The Internet Protocol · 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

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

Page 30: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

30

RARP Communication

Figure from Forouzan

Page 31: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

31

The Internet Protocol (IP)

● Unreliable● Connectionless● A “best effort” delivery service

Page 32: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

32

Datagram

Figure from Forouzan

Page 33: Lecture 2: The Internet Protocol · 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

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

Page 34: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

34

Options

Options are used for testing and debugging purposes

Figure from Forouzan

Page 35: Lecture 2: The Internet Protocol · 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

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

Page 36: Lecture 2: The Internet Protocol · 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

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

Page 37: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

37

IPv6

● Addressing● Packet format● Extension headers● Difference from IPv4● Transition from IPv4 to IPv6

Page 38: Lecture 2: The Internet Protocol · 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

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

Page 39: Lecture 2: The Internet Protocol · 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

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

Page 40: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

40

IPv6 Datagram

Figure from Forouzan

Page 41: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

41

Datagram format

Figure from Forouzan

Page 42: Lecture 2: The Internet Protocol · 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

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)

Page 43: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

43

Extension Header Format

Figure from Forouzan

Page 44: Lecture 2: The Internet Protocol · 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

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

Page 45: Lecture 2: The Internet Protocol · 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

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

Page 46: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

46

ICMPv6

● Message format● Difference from ICMPv4

Page 47: Lecture 2: The Internet Protocol · 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

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

Page 48: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

48

ICMPv6 message format

Figure from Forouzan

Page 49: Lecture 2: The Internet Protocol · 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

TSIN02 - Internetworking

49

ICMPv6 Error Messages

● Destination Unreachable● Packet Too Big● Time Exceeded● Parameter Problem