Introduction to Computer Networks CS640 IP Introduction

33
Ming Liu mgliu@cs.wisc.edu Introduction to Computer Networks CS640 https://pages.cs.wisc.edu/~mgliu/CS640/F21/ IP Introduction 1

Transcript of Introduction to Computer Networks CS640 IP Introduction

Page 1: Introduction to Computer Networks CS640 IP Introduction

Ming Liu [email protected]

Introduction to Computer Networks

CS640 https://pages.cs.wisc.edu/~mgliu/CS640/F21/

IP Introduction

1

Page 2: Introduction to Computer Networks CS640 IP Introduction

Today

Last lecture • L2 switching

2

Today • IP Introduction

Announcements • HW1 due today at 11:59PM

Page 3: Introduction to Computer Networks CS640 IP Introduction

TCP/IP Model

Hour Glass Model • Create abstraction layer that hides underlying

technology from network application software

• Make as minimal as possible

• Allow a range of current & future technologies • Can support many different types of applications

3

Page 4: Introduction to Computer Networks CS640 IP Introduction

TCP/IP Model

Hour Glass Model • Create abstraction layer that hides underlying

technology from network application software

• Make as minimal as possible

• Allow a range of current & future technologies

• Can support many different types of applications

3

Page 5: Introduction to Computer Networks CS640 IP Introduction

The Problem

4

Page 6: Introduction to Computer Networks CS640 IP Introduction

The Problem

How to connect heterogeneous networks? •L2 switching is not enough

Key to this is IP Protocol

4

Page 7: Introduction to Computer Networks CS640 IP Introduction

Internetworking

What is internetwork • An arbitrary collection of networks interconnected to provide some sort of host-host delivery service

5

Page 8: Introduction to Computer Networks CS640 IP Introduction

Internetworking

What is internetwork • An arbitrary collection of networks interconnected to provide some sort of host-host delivery service

What is IP • IP stands for Internet Protocol • A key tool used today to build scalable, heterogeneous internetwork • It runs on all the nodes in a collection of networks and defines the infrastructure that allows these nodes and networks to function as a single logical internetwork

5

Page 9: Introduction to Computer Networks CS640 IP Introduction

A Simple Internetwork Example

6

Page 10: Introduction to Computer Networks CS640 IP Introduction

A Simple Internetwork Example (cont’d)

H5 (Endpoint)

TCP

H8 (Endpoint)

IP

802.11

TCP

IP

ETH

R1

IP

802.11 ETH

R2

IP

ETH PPP

R3

IP

PPP ETH

6

Page 11: Introduction to Computer Networks CS640 IP Introduction

Routers have multiple interfaces • Each interface attached to one switched network, and speak the link layer protocol of that switched network

A Key Hardware — Router

7

Page 12: Introduction to Computer Networks CS640 IP Introduction

Service Model

What kind of host-to-host service? • Main challenges: can only provided something supported by individual physical layer

8

Page 13: Introduction to Computer Networks CS640 IP Introduction

Service Model

What kind of host-to-host service? • Main challenges: can only provided something supported by individual physical layer

#1: Addressing Scheme (horizontal view) • A way to identify all hosts in the internet work

#2: Datagram (connectionless) delivery (vertical view) • Best effort • Packets can be lost • Packets can be delivered out of order • Packets can be duplicated

• Packets can be delayed for a long time8

Page 14: Introduction to Computer Networks CS640 IP Introduction

IP Packet Format

Ctrl2B

Duration2B

Addr1 Addr26B 6B

SeqCtrlAddr3 Addr46B 2B 6B

Payload CRC0-2312B 4B

Preamble8B

Dest Source Type Data CRCPad6B 6B 2B 4B

Ethernet frame

802.11 frame

IP

9

Page 15: Introduction to Computer Networks CS640 IP Introduction

IP Packet Format

Version (4) • IP version number • Default: 4

Offsets0

4

8

12

16

20

HLen (4) • Number of 32-bit words in header

TOS (8) • Type of service

• 6-bit DSCP (Differentiated service)

• 2-bit ECN (Explicit Congestion

Notification)

9

Page 16: Introduction to Computer Networks CS640 IP Introduction

IP Packet Format (cont’d)

Length (16) • Number of bytes in this datagram

Offsets0

4

8

12

16

20

Identification (16) • Used by fragmentation

Flags (3)/Offset (13) • Used by fragmentation

10

Page 17: Introduction to Computer Networks CS640 IP Introduction

IP Packet Format (cont’d)

TTL (8) • Number of hops this datagram

has traveled, decremented at every router to prevent packets from lingering

Offsets0

4

8

12

16

20Protocol (8) • Demux key (TCP=6, UDP=17)

11

Page 18: Introduction to Computer Networks CS640 IP Introduction

IP Packet Format (cont’d)

Checksum (16) • of the header only, needs recompilation at every hop as TTL

changes

Offsets0

4

8

12

16

20

SourceAddr (32) • Source address

DestAddr (32) • Destination address

12

Page 19: Introduction to Computer Networks CS640 IP Introduction

Fragmentation and Reassembly

Each network has some Maximum Transmission Unit (MTU) • Largest datagram that a network can carry in a frame

13

Page 20: Introduction to Computer Networks CS640 IP Introduction

MTU example

H5 (Endpoint)

TCP

H8 (Endpoint)

IP

802.11

TCP

IP

ETH

R1

IP

802.11 ETH

R2

IP

ETH PPP

R3

IP

PPP ETH

13

1500B 1500B500B1500B

Page 21: Introduction to Computer Networks CS640 IP Introduction

Fragmentation and Reassembly

Each network has some Maximum Transmission Unit (MTU) • Largest datagram that a network can carry in a frame

Strategy • #1: Fragment when necessary (MTU < Datagram)

• #2: Try to avoid fragmentation at source host • #3: Re-fragmentation is possible

• #4: Delay reassembly until destination host • Keep this functionality out of the network

• #5: Do not recover from lost fragments13

Page 22: Introduction to Computer Networks CS640 IP Introduction

Avoiding Fragmentation

Path MTU discovery • Originally introduced by IPv4; IPv6 delegate it to the end points; • Modern operating systems use it;

Key idea • Set the Don’t Fragment (DF) flag bit in the IP header • Any device along the path whose MTU is smaller than the packet will drop it, and send

back an Internet Control Message Protocol (ICMP) message containing its MTU

• Source nodes than reduce its path MTU accordingly

14

Page 23: Introduction to Computer Networks CS640 IP Introduction

An ExampleH5 (Endpoint)

TCP

H8 (Endpoint)

IP

802.11

TCP

IP

ETH

R1

IP

802.11 ETH

R2

IP

ETH PPP

R3

IP

PPP ETH

802.11 IP 1400 ETH IP 1400 PPP IP 512

PPP IP 512

PPP IP 512

ETH IP 512

ETH IP 512

ETH IP 512 15

Page 24: Introduction to Computer Networks CS640 IP Introduction

An Example (cont’d)

Ident = x

Start of header

0 Offset = 0Rest of header

1400 data bytes

Ident = xStart of header

1 Offset = 0

Rest of header512 data bytes

Ident = xStart of header

1 Offset = 64Rest of header

512 data bytes

Ident = xStart of header

0 Offset = 128

Rest of header376 data bytes 16

Page 25: Introduction to Computer Networks CS640 IP Introduction

An Example (cont’d)

Ident = x

Start of header

0 Offset = 0Rest of header

1400 data bytes

Ident = xStart of header

1 Offset = 0

Rest of header512 data bytes

Ident = xStart of header

1 Offset = 64Rest of header

512 data bytes

Ident = xStart of header

0 Offset = 128

Rest of header376 data bytes 16

https://github.com/torvalds/linux/blob/master/net/ipv4/ip_fragment.c

Page 26: Introduction to Computer Networks CS640 IP Introduction

Global Addresses

Properties • IPv4 uses 32 bit address space

• Globally unique

• Hierarchical addresses: <network, host> to addresses • Called “classful addressing”

17

Page 27: Introduction to Computer Networks CS640 IP Introduction

Global Addresses (cont’d)

Dot notation • 10.3.2.4

• 128.96.33.81

• 192.12.69.77

A: Network0 Host7

1 0B:

1 01C:

D: 1 011

E: 1 0111 Experimental

Multicast

Network Host

Network Host

21 8

14 16

24

18

Page 28: Introduction to Computer Networks CS640 IP Introduction

Global Addresses (cont’d)

Assigning authority • Assigned by ICANN (Internet Corporation for Assigned Names and Numbers)

19

Chief advantage of classful IP address for routing • Routers can keep one entry per network instead of one per destination host

Page 29: Introduction to Computer Networks CS640 IP Introduction

How Forwarding would work

20

Page 30: Introduction to Computer Networks CS640 IP Introduction

How Forwarding would work

20

Page 31: Introduction to Computer Networks CS640 IP Introduction

How Forwarding would work (cont’d)

21

Page 32: Introduction to Computer Networks CS640 IP Introduction

How Forwarding would work (cont’d)

Network Number NextHop

1 R1

2 Interface 1

3 Interface 0

4 R3

21

Page 33: Introduction to Computer Networks CS640 IP Introduction

Summary

Today • IP Introduction

Next lecture • Subnetting/Supernetting

• ARP/DHCP/ICMP

22