Introduction to Computer Networks CS640 IP Introduction

Post on 25-Dec-2021

5 views 0 download

transcript

Ming Liu mgliu@cs.wisc.edu

Introduction to Computer Networks

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

IP Introduction

1

Today

Last lecture • L2 switching

2

Today • IP Introduction

Announcements • HW1 due today at 11:59PM

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

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

The Problem

4

The Problem

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

Key to this is IP Protocol

4

Internetworking

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

5

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

A Simple Internetwork Example

6

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

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

Service Model

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

8

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

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

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

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

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

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

Fragmentation and Reassembly

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

13

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

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

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

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

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

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

Global Addresses

Properties • IPv4 uses 32 bit address space

• Globally unique

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

17

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

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

How Forwarding would work

20

How Forwarding would work

20

How Forwarding would work (cont’d)

21

How Forwarding would work (cont’d)

Network Number NextHop

1 R1

2 Interface 1

3 Interface 0

4 R3

21

Summary

Today • IP Introduction

Next lecture • Subnetting/Supernetting

• ARP/DHCP/ICMP

22