Network Layer: outline 1 introduction 5 routing algorithms link - - PowerPoint PPT Presentation

network layer outline
SMART_READER_LITE
LIVE PREVIEW

Network Layer: outline 1 introduction 5 routing algorithms link - - PowerPoint PPT Presentation

Network Layer: outline 1 introduction 5 routing algorithms link state 2 virtual circuit and datagram networks distance vector hierarchical routing 3 what s inside a router 6 routing in the Internet 4 IP: Internet Protocol


slide-1
SLIDE 1

1 introduction 2 virtual circuit and datagram networks 3 what’s inside a router 4 IP: Internet Protocol

  • datagram format
  • IPv4 addressing
  • ICMP
  • IPv6

5 routing algorithms

  • link state
  • distance vector
  • hierarchical routing

6 routing in the Internet

  • RIP
  • OSPF
  • BGP

7 broadcast and multicast routing

Network Layer: outline

1

slide-2
SLIDE 2

A B

Physical Data link Network Transport Application Physical Data link Network Transport Application

Internet

Figure Internet as a block box

Message Message

2

slide-3
SLIDE 3

Figure Internet as a combination of LANs and WANs connected together

3

slide-4
SLIDE 4

SWITCHING

Fr From

  • m the

the pr prev evio ious us di disc scus ussion, sion, it it is is cl clea ear tha that th the passage passage

  • f
  • f

a mes essa sage ge fro from a so sour urce ce to to a de dest stin inati ation

  • n

in invo volv lves es man many de deci cisi sion

  • ns.

Whe hen a mes essa sage ge re reac aches es a co conn nnec ectin ting de devi vice ce, a de deci cisi sion

  • n

ne needs eds to to be be made made to to se select lect one

  • ne of
  • f the

he out

  • utput

put por ports ts thr throu

  • ugh

gh whi hich ch the the packet packet nee needs ds to to be be send send out

  • ut. In

In

  • th
  • ther

er word words, s, the the conn connec ectin ting de devi vice ce ac acts ts as as a swit switch ch that conne nect cts one

  • ne port

port to to anothe her port port.

4

slide-5
SLIDE 5

 Circuit Switching

A physical circuit (channel) is established between the

source and destination before the delivery of the message

Never implemented at the network layer; it is mostly used

at the physical layer

In circuit switching, the whole message is sent from the source to the destination without being divided into packets.

5

slide-6
SLIDE 6

 Packet Switching

Datagram approach Virtual circuit approach

In packet switching, the message is first divided into manageable packets at the source before being transmitted. The packets are assembled at the destination.

6

slide-7
SLIDE 7

Sender Network Network Receiver Out of order R3 R4 R5 R1 R2

A connectionless packet-swtiched network

Figure A connectionless packet-switched network

4 3 2 1 1 2 3 4 2 3 3 1 4 4 3 2 1

7

slide-8
SLIDE 8

Network layer

 transport segment from

sending to receiving host

 on sending side

encapsulates segments into datagrams

 on receiving side, delivers

segments to transport layer

 network layer protocols

in every host, router

 router examines header

fields in all IP datagrams passing through it

application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical

8

slide-9
SLIDE 9

Two key network-layer functions

 forwarding: move packets

from router’s input to appropriate router

  • utput

 routing: determine route

taken by packets from source to dest.

  • routing algorithms

analogy:

 routing: process of

planning trip from source to dest

 forwarding: process of

getting through single interchange

9

slide-10
SLIDE 10

1

2 3

0111

value in arriving packet’s header

routing algorithm local forwarding table header value output link

0100 0101 0111 1001 3 2 2 1

Interplay between routing and forwarding

routing algorithm determines end-end-path through network forwarding table determines local forwarding at this router

10

slide-11
SLIDE 11

1 introduction 2 virtual circuit and datagram networks 3 what’s inside a router 4 IP: Internet Protocol

  • datagram format
  • IPv4 addressing
  • ICMP
  • IPv6

5 routing algorithms

  • link state
  • distance vector
  • hierarchical routing

6 routing in the Internet

  • RIP
  • OSPF
  • BGP

7 broadcast and multicast routing

Network Layer: outline

11

slide-12
SLIDE 12

Connection, connection-less service

 datagram network provides network-layer

connectionless service

 virtual-circuit network provides network-layer

connection service

 analogous to TCP/UDP connection-oriented /

connectionless transport-layer services

12

slide-13
SLIDE 13

Sender Network Network Receiver Out of order R3 R4 R5 R1 R2

A connectionless packet-swtiched network

Figure A connectionless packet-switched network

4 3 2 1 1 2 3 4 2 3 3 1 4 4 3 2 1

13

slide-14
SLIDE 14

Figure Forwarding process in a connectionless network

1 2 4 3

Output interface Destination address

Routing table

1 2 3 A B H Destination address

SA DA Data Send the packet

  • ut of interface 2

SA DA Data

Legend

SA: Source address DA: Destination address

In a connectionless packet-switched network, the forwarding decision is based on the destination address of the packet.

14

slide-15
SLIDE 15

Time Time Time Time Souce Destination

Figure Delay in a connectionless network

1 2 3 Total delay

15

slide-16
SLIDE 16

Figure A connection-oriented packet switched network

4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1

16

slide-17
SLIDE 17

Figure Forwarding process in a connection-oriented network

1 2 3 4 Routing Table

Port Port 2 L1 L2 1 Label Label Outgoing Incoming

Legend

SA: Source address DA: Destination address L1, L2: Labels

In a connection-oriented packet switched network, the forwarding decision is based on the VC number of the packet.

17

slide-18
SLIDE 18

1 1 1 4 4 2 2 2 3 3 3

A B

Network Network R3 R5 R4 R1 R2 Request packet Virtual circuit

Legend A to B

Figure Sending request packet in a virtual-circuit network

A to B

1

A to B

2

A to B

3

A to B

4 Label

Port Port 3 14 1 Label Outgoing Incoming

A to B

Port Port 3 66 1 Label Label Outgoing Incoming

A to B

Label

A to B

Port Port 4 22 1 Label Outgoing Incoming

18

slide-19
SLIDE 19

Figure Setup acknowledgement in a virtual-circuit network

Port Port 3 1 1 1 4 4 2 2 2 3 3 3 14 1 Label Label Label Label Outgoing Incoming Port Port 3 66 1 Label Outgoing Incoming

A B A to B A to B A to B

Network Network R3 R5 Port Port 4 22 1 Label Outgoing Incoming R4 R1 R2 Acknowledge packet Virtual circuit

Legend

77 1 22 2 66 3 14 4 77 22 66

19

slide-20
SLIDE 20

1 1 1 4 4 2 2 2 3 3 3

A

Network Network R3 R5 R4 R1 R2 Port Port 3 14 66 1 Label Label Outgoing Incoming 22 Label Port Port 3 66 1 Label Outgoing Incoming

A to B A to B A to B

Label Port Port 4 22 1 Label Outgoing Incoming 77 Data

B A

Datagram Virtual circuit

Legend

Figure Flow of one packet in an established virtual circuit

Data

B A

14 Data

B A

66 Data

B A

22 Data

B A

77

20

slide-21
SLIDE 21

Time Time Time Time Source Destination

Figure Delay in a connection-oriented network

1 2 Transmission time 3 4 5 Setup Teardown

Total delay

6 7

21

slide-22
SLIDE 22

Virtual circuits

 call setup, teardown for each call before data can flow  each packet carries VC identifier (not destination host

address)

 every router on source-dest path maintains “state” for

each passing connection

 link, router resources (bandwidth, buffers) may be

allocated to VC (dedicated resources = predictable service)

“source-to-dest path behaves much like telephone circuit”

  • performance-wise
  • network actions along source-to-dest path

22

slide-23
SLIDE 23

VC implementation

a VC consists of:

  • 1. path from source to destination
  • 2. VC numbers, one number for each link along path
  • 3. entries in forwarding tables in routers along path

packet belonging to VC carries VC number (rather than dest address)

VC number can be changed on each link.

  • new VC number comes from forwarding table

23

slide-24
SLIDE 24

VC forwarding table

12 22 32

1 2 3

VC number interface number Incoming interface Incoming VC # Outgoing interface Outgoing VC # 1 12 3 22 2 63 1 18 3 7 2 17 1 97 3 87 … … … …

forwarding table in northwest router:

VC routers maintain connection state information!

24

slide-25
SLIDE 25

application transport network data link physical

Virtual circuits: signaling protocols

 used to setup, maintain teardown VC  used in ATM, frame-relay, X.25  not used in today’s Internet

  • 1. initiate call
  • 2. incoming call
  • 3. accept call
  • 4. call connected
  • 5. data flow begins
  • 6. receive data

application transport network data link physical

25

slide-26
SLIDE 26

Datagram networks: Connectionless

 no call setup at network layer  routers: no state about end-to-end connections

  • no network-level concept of “connection”

 packets forwarded using destination host address

  • 1. send datagrams

application transport network data link physical application transport network data link physical

  • 2. receive datagrams

26

slide-27
SLIDE 27

1

2 3

Datagram forwarding table

IP destination address in arriving packet’s header

routing algorithm local forwarding table dest address output link

address-range 1 address-range 2 address-range 3 address-range 4 3 2 2 1

4 billion IP addresses, so rather than list individual destination address list range of addresses (aggregate table entries)

27

slide-28
SLIDE 28

Destination Address Range 11001000 00010111 00010000 00000000 through 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 through 11001000 00010111 00011000 11111111 11001000 00010111 00011001 00000000 through 11001000 00010111 00011111 11111111

  • therwise

Link Interface 1 2 3

Q: but what happens if ranges don’t divide up so nicely?

Datagram forwarding table

28

slide-29
SLIDE 29

Longest prefix matching

Destination Address Range 11001000 00010111 00010*** ********* 11001000 00010111 00011000 ********* 11001000 00010111 00011*** *********

  • therwise

DA: 11001000 00010111 00011000 10101010

examples:

DA: 11001000 00010111 00010110 10100001

which interface? which interface?

when looking for forwarding table entry for given destination address, use longest address prefix that matches destination address. longest prefix matching

Link interface 1 2 3

29

slide-30
SLIDE 30

Datagram or VC network: why?

Internet (datagram)

 data exchange among

computers

  • “elastic” service, no strict

timing req.

 many link types

  • different characteristics
  • uniform service difficult

 “smart” end systems

(computers)

  • can adapt, perform control,

error recovery

  • simple inside network,

complexity at “edge”

ATM (VC)

 evolved from telephony  human conversation:

  • strict timing, reliability

requirements

  • need for guaranteed service

 “dumb” end systems

  • telephones
  • complexity inside

network

30

slide-31
SLIDE 31

1 introduction 2 virtual circuit and datagram networks 3 what’s inside a router 4 IP: Internet Protocol

  • datagram format
  • IPv4 addressing
  • ICMP
  • IPv6

5 routing algorithms

  • link state
  • distance vector
  • hierarchical routing

6 routing in the Internet

  • RIP
  • OSPF
  • BGP

7 broadcast and multicast routing

Network Layer: outline

31

slide-32
SLIDE 32

Router architecture overview

two key router functions:

 run routing algorithms/protocol (RIP, OSPF, BGP)  forwarding datagrams from incoming to outgoing link

high-seed switching fabric routing processor router input ports router output ports

forwarding data plane (hardware) routing, management control plane (software)

forwarding tables computed, pushed to input ports 32

slide-33
SLIDE 33

line termination link layer protocol (receive) lookup, forwarding queueing

Input port functions

decentralized switching:

 given datagram dest., lookup output port

using forwarding table in input port memory (“match plus action”)

 goal: complete input port processing at

‘line speed’

 queuing: if datagrams arrive faster than

forwarding rate into switch fabric

physical layer: bit-level reception data link layer: e.g., Ethernet

switch fabric

33

slide-34
SLIDE 34

Switching fabrics

 transfer packet from input buffer to appropriate

  • utput buffer

 switching rate: rate at which packets can be

transfer from inputs to outputs

  • often measured as multiple of input/output line rate
  • N inputs: switching rate N times line rate desirable

 three types of switching fabrics memory

memory

bus crossbar

34

slide-35
SLIDE 35

Switching via memory

first generation routers:

 traditional computers with switching under direct control

  • f CPU

 packet copied to system’s memory  speed limited by memory bandwidth (2 bus crossings per

datagram)

input port (e.g., Ethernet) memory

  • utput

port (e.g., Ethernet) system bus

35

slide-36
SLIDE 36

Switching via a bus

 datagram from input port memory

to output port memory via a shared bus

 bus contention: switching speed

limited by bus bandwidth

 32 Gbps bus, Cisco 5600: sufficient

speed for access and enterprise routers

bus

36

slide-37
SLIDE 37

Switching via interconnection network

 overcome bus bandwidth limitations  banyan networks, crossbar, other

interconnection nets initially developed to connect processors in multiprocessor

 advanced design: fragmenting

datagram into fixed length cells, switch cells through the fabric.

 Cisco 12000: switches 60 Gbps

through the interconnection network

crossbar

37

slide-38
SLIDE 38

Output ports

 buffering required when datagrams arrive

from fabric faster than the transmission rate

 scheduling discipline chooses among queued

datagrams for transmission

line termination link layer protocol (send) switch fabric datagram buffer queueing

Datagram (packets) can be lost due to congestion, lack of buffers Priority scheduling – who gets best performance, network neutrality

38

slide-39
SLIDE 39

Output port queueing

 buffering when arrival rate via switch exceeds

  • utput line speed

 queueing (delay) and loss due to output port buffer

  • verflow!

at t, packets more from input to output

  • ne packet time later

switch fabric switch fabric

39

slide-40
SLIDE 40

How much buffering?

 RFC 3439 rule of thumb: average buffering equal

to “typical” RTT (say 250 msec) times link capacity C

  • e.g., C = 10 Gpbs link: 2.5 Gbit buffer

 recent recommendation: with N flows, buffering

equal to

RTT C

.

N

40

slide-41
SLIDE 41

Input port queuing

 fabric slower than input ports combined -> queueing may

  • ccur at input queues
  • queueing delay and loss due to input buffer overflow!

 Head-of-the-Line (HOL) blocking: queued datagram at front

  • f queue prevents others in queue from moving forward
  • utput port contention:
  • nly one red datagram can be

transferred. lower red packet is blocked

switch fabric

  • ne packet time later:

green packet experiences HOL blocking

switch fabric

41

slide-42
SLIDE 42

1 introduction 2 virtual circuit and datagram networks 3 what’s inside a router 4 IP: Internet Protocol

  • datagram format
  • IPv4 addressing
  • ICMP
  • IPv6

5 routing algorithms

  • link state
  • distance vector
  • hierarchical routing

6 routing in the Internet

  • RIP
  • OSPF
  • BGP

7 broadcast and multicast routing

Network Layer: outline

42

slide-43
SLIDE 43

The Internet network layer

forwarding table

host, router network layer functions:

routing protocols

  • path selection
  • RIP, OSPF, BGP

IP protocol

  • addressing conventions
  • datagram format
  • packet handling conventions

ICMP protocol

  • error reporting
  • router

“signaling”

transport layer: TCP, UDP link layer physical layer

network layer

43

slide-44
SLIDE 44

Figure 7.2 IP datagram

44

slide-45
SLIDE 45

ver length 32 bits

data (variable length, typically a TCP

  • r UDP segment)

16-bit identifier header checksum time to live 32 bit source IP address head. len type of service flag fragment

  • ffset

upper layer 32 bit destination IP address

  • ptions (if any)

IP datagram format

IP protocol version number header length (in 4-byte words) upper layer protocol to deliver payload to total datagram length (bytes) “type” of data for fragmentation/ reassembly max number remaining hops (decremented at each router) 0-40 bytes e.g. timestamp, record route taken, specify list of routers to visit.

Length of data?

 Total length –

header length how much overhead?

 20 - 60 bytes of IP

45

slide-46
SLIDE 46

Service Type

Precedence interpretation x x x 1 x x x x x x x x x x x x 1 1 Differential service interpretation x

46

slide-47
SLIDE 47
  • Time to live: control the maximum number of hops (routers) visited
  • If the value is zero, he router discards the datagram
  • Protocol: the higher-level protocol that uses the services of the IP layer

47

slide-48
SLIDE 48

An An IP IP packet et has has arri rive ved wi with the first st 8 bits as as shown wn:

Example 1

The The receiver iver discard ards the packet

  • et. Why?

Soluti tion

  • n

There There is is an an error error in in th this is pa packet

  • cket. The 4 left

left-most

  • st bi

bits ts (0100 0100) sho show the the versi version,

  • n, wh

which ich is is corr correct

  • ect. Th

The next ext 4 bi bits ts (00 0010 10) show the the wr wron

  • ng hea

header er len ength gth (2 × 4 = 8). The The mi minimum imum number umber of

  • f

bytes bytes in in the the he head ader er must ust be be 20

  • 20. Th

The packet packet has has been been corr corrupted upted in in transmissi nsmission

  • n.

48

slide-49
SLIDE 49

In In an an IP IP pack acket et, the the va value ue of

  • f HLE

HLEN (he (heade ader le length) ngth) is is 1000 1000 in in binary

  • inary. Ho

How many many bytes bytes of

  • f op
  • ptio

ions ns are are being ing carried carried by by th this is packet? acket? Soluti tion

  • n

The The HLEN HLEN val value ue is is 8, wh which ich mean means the the total total nu numb mber er of

  • f bytes

bytes in in the the he head ader er is is 8 × 4 or

  • r 32

32 bytes

  • bytes. Th

The first first 20 20 bytes bytes are are the the base base header, r, the next 12 12 bytes es are the options

  • ns.

Example 2

49

slide-50
SLIDE 50

In In an an IP IP pack acket et, the the va value ue of

  • f HLEN is

is 516

16 and

nd the the valu value of

  • f the

the total total length length field field is is 00 002816

  • 16. How

How ma many ny byte bytes of

  • f da

data ta are re being being carri ried ed by by this packet? et? Soluti tion

  • n

The The HLEN HLEN val value ue is is 5, wh which ich mean means the the total total nu numb mber er of

  • f bytes

bytes in in the the he head ader er is is 5 × 4 or

  • r 20

20 bytes bytes (no (no opti

  • ptions)
  • ns). The

The tot total al length length is is 40 40 bytes bytes, wh which ich means means the the packet packet is is carr carrying ng 20 20 byte bytes of

  • f data

data (40 40 − 20 20).

Example 3

50

slide-51
SLIDE 51

An An IP IP packet packet has has ar arrive rived wi with th the the first first few few hex hexad adec ecima imal digits digits as as shown wn belo low:

Example 4

Ho How many any hops

  • ps ca

can this this pack packet et tr travel avel bef efor

  • re be

being ing dr dropped

  • pped?

The The data belong to to what upper upper layer proto tocol? col? So Solu luti tion

  • n

To To fin find the the time time-to to-li live ve fie field, d, we we ski skip 8 byt bytes es (16 16 hexadec hexadecima imal digi gits) ts). The The time time-to to-live ive fie field ld is is th the nin inth th byt byte, e, wh which ich is is 01

  • 01. Th

This is me means ans the the packet acket can can tr trave avel on

  • nly

ly one

  • ne ho
  • hop. Th

The protoc protocol fi field eld is is the the ne next xt byte byte (02 02), ), which which mean means that at the the upper upper la layer er pr protoco

  • tocol is

is IGM GMP.

51

slide-52
SLIDE 52

IP fragmentation, reassembly

 network links have MTU

(max.transfer size) - largest possible link-level frame

  • different link types,

different MTUs

 large IP datagram divided

(“fragmented”) within net

  • one datagram becomes

several datagrams

  • “reassembled” only at

final destination

  • IP header bits used to

identify, order related fragments

fragmentation: in: one large datagram

  • ut: 3 smaller datagrams

reassembly

… …

52

slide-53
SLIDE 53

ver length 32 bits

data (variable length, typically a TCP

  • r UDP segment)

16-bit identifier header checksum time to live 32 bit source IP address head. len type of service flag fragment

  • ffset

upper layer 32 bit destination IP address

  • ptions (if any)

IP datagram format

IP protocol version number header length (in 4-byte words) upper layer protocol to deliver payload to total datagram length (bytes) “type” of data for fragmentation/ reassembly max number remaining hops (decremented at each router) 0-40 bytes e.g. timestamp, record route taken, specify list of routers to visit.

Length of data?

 Total length –

header length how much overhead?

 20 - 60 bytes of IP

53

slide-54
SLIDE 54

Flags field

1 cannot fragment the datagram D = 0 can be fragmented if necessary 1 the datagram is not the last fragment M = 0 this is the last or only fragment

54

slide-55
SLIDE 55

example:

 4000 byte datagram  MTU = 1400 bytes

IP fragmentation, reassembly

0000 1399 Offset = 0000/8 = 0 1400 2799 Offset = 1400/8 = 175 2800 3999 Offset = 2800/8 = 350

55

slide-56
SLIDE 56

Detailed fragmentation example

000 4020 14,567 Bytes 0000–3999 Original datagram 175 1420 14,567 Bytes 1400–2799 Fragment 2 1 350 1220 14,567 Bytes 2800–3999 Fragment 3 175 820 14,567 Bytes 1400–2199 Fragment 2.1 1 Fragment 1 000 1420 14,567 Bytes 0000–1399 1 56

slide-57
SLIDE 57

A packet acket has has arr arrived ived with with an an M bit it value value of

  • f 0. Is

Is this this the the first first fr frag agment, ment, the la last st fr fragme agment nt, or

  • r a mi

middl ddle fragme ragment? nt? Do Do we we know know if if the packet ket wa was fragme agment nted? d? Soluti tion

  • n

If If the the M bi bit is is 0, it it me means ns that that th ther ere are are no no more more fr frag agments ments; the the fr fragment agment is is the the la last st on

  • ne. Howev

However er, we we can cannot not say say if if the the or

  • rigi

igina nal packet acket wa was frag fragme ment nted or

  • r not
  • not. A non

nonfr fragm agmented ented pack packet et is is considere dered the last fragment gment.

Example 5

57

slide-58
SLIDE 58

A packet acket has has arr arrived ived with with an an M bit it value value of

  • f 1. Is

Is this this the the first first fr frag agment, ment, the la last st fr fragme agment nt, or

  • r a mi

middl ddle fragme ragment? nt? Do Do we we know know if if the packet ket wa was fragme agment nted? d? Soluti tion

  • n

If If the the M bit it is is 1, it it me mean ans that that there there is is at at least least one more more fr fragment

  • agment. Th

This is frag fragme ment nt can can be be the the first first one or

  • r a mid

middle le on

  • ne,

e, but ut not not the the last ast on

  • ne. We

We don’t know if if it it is is the the first first one or

  • r a

mi midd ddle one

  • ne; we

we nee eed mor more inform informatio ation (the (the valu value of

  • f the

the fragme agmentatio ntation offset fset). See also the next examp mple.

Example 6

58

slide-59
SLIDE 59

A pack packet et has has arr arrived ived with with an an M bi bit va value ue of

  • f 1 and

and a fr frag agmentation mentation of

  • ffset

fset value lue of

  • f zer
  • zero. Is

Is th this is the the first first fr frag agme ment nt, the the last fragme agment nt, or

  • r a middle fra

ragment? gment? Soluti tion

  • n

Beca Because use th the M bi bit is is 1, it it is is eithe ither the the first first fragmen gment or

  • r a mi

middl ddle

  • ne
  • ne. Becaus

use the off ffset set value is is 0, it it is is the first st frag agment ment.

Example 7

59

slide-60
SLIDE 60

A pack packet et has as arr arrived ived in in whic which th the of

  • ffset

fset value value is is 100

  • 100. What

What is is the the nu numbe ber of

  • f the

the first first byte byte? Do Do we we kno know the the nu number mber of

  • f the

the last last byte? e? Soluti tion

  • n

To To find find the the nu numb mber er of

  • f the

the first first byte, byte, we we mu mult ltip iply ly the the of

  • ffset

set val value ue by by 8. Thi This me means ans that that the the first first byte yte numb number er is is 800

  • 800. We

We cannot annot determ etermine ine the the number umber of

  • f the

the last last by byte te unless unless we we kn know the the length th of

  • f the data.

Example 8

60

slide-61
SLIDE 61

A pack packet et has as arr arrived ived in in whic which th the of

  • ffset

fset value value is is 10 100, the the value value

  • f
  • f HLE

HLEN (header eader len length) gth) is is 5 and the the val value of

  • f the

the tota

  • tal le

length gth fie field is is 100

  • 00. What

What is is the the num number ber of

  • f the

the first first byte byte and and the the last ast byte? e? So Solu luti tion

  • n

Th The firs first by byte te number number is is 100 100 × 8 = 800

  • 800. The

The tot total al length length is is 100 100 bytes bytes and nd the the he head ader er length ngth is is 20 20 bytes bytes (5 × 4), ), which which me means ans that that ther there ar are 80 80 bytes bytes in in this this datagram

  • datagram. If

If the the first first byt byte number number is is 800 800, the last byte te number er must st be be 879 879.

Example 9

61

slide-62
SLIDE 62

1 introduction 2 virtual circuit and datagram networks 3 what’s inside a router 4 IP: Internet Protocol

  • datagram format
  • IPv4 addressing
  • ICMP
  • IPv6

5 routing algorithms

  • link state
  • distance vector
  • hierarchical routing

6 routing in the Internet

  • RIP
  • OSPF
  • BGP

7 broadcast and multicast routing

Network Layer: outline

62

slide-63
SLIDE 63

IP addressing: introduction

 IP address: 32-bit

identifier for host, router interface

 interface: connection

between host/router and physical link

  • router’s typically have

multiple interfaces

  • host typically has one or

two interfaces (e.g., wired Ethernet, wireless 802.11)

 IP addresses associated

with each interface

223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27

223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1

63

slide-64
SLIDE 64

Find the error,

  • r, if

if any, in in the followin wing IPv4 addresses sses:

  • a. 111

111.56 56.045 045.78 78

  • b. 221

221.34 34.7.8.20 20

  • c. 75

75.45 45.30 301.14 14

  • d. 11100010

10.23 23.14 14.67 67 Soluti tion

  • n
  • a. There

re should be be no no leading zeroes es (045 045).

  • b. We

We may not not have more than 4 bytes es in in an an IPv4 address ss.

  • c. Each byte should be

be less than or

  • r equal

equal to to 255 255.

  • d. A mixt

xture ure of

  • f binary notati

ation

  • n and

and dotted ted-decim ecimal al notati ation

  • n.

Example 1

64

slide-65
SLIDE 65

Find ind the the num number ber of

  • f addresses

dresses in in a ran range ge if if the the first first ad address dress is is 146 146.102 102.29 29.0 and and the last address ess is is 146 146.10 102.32 32.255 255. Soluti tion

  • n

We We can can sub subtr tract act the the first first ad addr dress ess fr from

  • m the

the la last st ad address dress in in ba base se 256 56 (se (see Appe Append ndix ix B) B). The The resu result lt is is 0.0.3.25 255 in in this this base

  • ase. To

To fin find the the num umber ber of

  • f address

ddresses es in in the the ra range ge (in (in dec decima imal), l), we we convert ert this is number er to to base 10 10 and and add add 1 to to the result lt.. ..

Example 2

65

slide-66
SLIDE 66

Th The firs first ad address dress in in a rang range of

  • f addresses

dresses is is 14 14.11 11.45 45.96

  • 96. If

If the the number umber of

  • f address

ddresses es in in the the rang range is is 32 32, what hat is is the the last ast address? ess? So Solu luti tion

  • n

We We conver convert the the numb number er of

  • f add

address resses es minus minus 1 to to base base 256 256, wh which ich is is 0.0.0.31

  • 31. We

We then then add dd it it to to the the first first add address ress to to get get the the la last address

  • ess. Ad

Addit ition ion is is in in base 256 256.

Example 3

66

slide-67
SLIDE 67

Figure Bitwise NOT operation

67

slide-68
SLIDE 68

Example 4

68

slide-69
SLIDE 69

Figure Bitwise AND operation

69

slide-70
SLIDE 70

Example 5

70

slide-71
SLIDE 71

Figure Bitwise OR operation

71

slide-72
SLIDE 72

Example 6

72

slide-73
SLIDE 73

Classful Addressing

  • When IP addressing was first started, it used a concept called

“classful addressing”. A newer concept called “classless addressing” is slowly replacing it though.

  • Regarding “classful addressing”, the address space is divided

into five classes: A, B, C, D and E.

Class # of addresses Percent of the Space

73

slide-74
SLIDE 74

Figure Finding the class of address

1 Class: A Start 1 Class: B 1 Class: C 1 Class: D Class: E

74

slide-75
SLIDE 75

Find the class s of each address: ss: a.

  • a. 000000

000001 01 00001011 11 00001011 11 11101111 111 b.

  • b. 1100

0000 0001 01 10000011 11 00011011 11 1111111 111 c.

  • c. 10100

0011 111 1 1101101 011 1 10001011 1 01101111 11 d.

  • d. 1111

1100 0011 11 10011011 11 11111011 11 0000111 111 Soluti tion

  • n
  • a. The first

st bit is 0. This is a cl class s A ad address. ess. b.

  • b. The first

st 2 bi bits s are 1; the third rd bit is 0. This is a cl class s C C address. ess. c.

  • c. The

e first rst bit is 1; the second nd bit is 0. This is a class s B address. ess. d.

  • d. The

he first st 4 bi bits s are 1s. This is a class s E address. ss.

Example 7

75

slide-76
SLIDE 76

Find the class of

  • f each address

ss:

  • a. 227

227.12 12.14 14.87 87

  • b. 193

193.14 14.56 56.22 22

  • c. 14

14.23 23.12 120.8

  • d. 252

252.5.15 15.111 11 Soluti tion

  • n

a.

  • a. The

e first st byte e is 227 7 (bet etween ween 224 4 and d 239); 9); the clas ass s is D. b.

  • b. The

e first st byte e is 193 3 (bet etween ween 192 2 and d 223); 3); the clas ass s is C.

  • c. The first

st byte is is 14 14 (be between een 0 and and 127 127); the clas ass is is A.

  • d. The first

st byte is is 252 252 (bet etween ween 240 240 and and 255 255); the clas ass is is E.

Example 8

76

slide-77
SLIDE 77

Figure Netid and hostid

77

slide-78
SLIDE 78

Figure Blocks in Class A

  • Class A has 128 blocks or network ids
  • First byte is the same (netid), the remaining 3 bytes can change (hostids)
  • Network id 0 (first), Net id 127 (last) and Net id 10 are reserved – leaving 125 ids to

be assigned to organizations/companies

  • Each block contains 16,777,216 addresses – this block should be used by large
  • rganizations.
  • The first address in the block is called the “network address” – defines the network
  • f the organization

Example

  • Netid 73 is assigned
  • Last address is reserved
  • Recall: routers have addressees

78

slide-79
SLIDE 79

Figure Blocks in Class B

  • Class B is divided into 16,384 blocks (65,536 addresses each)
  • 16 blocks are reserved
  • First 2 bytes are the same (netid), the remaining 2 bytes can change (hostids)
  • For example, Network id 128.0 covers addresses 128.0.0.0 to 128.0.255.255
  • Network id 191.225 is the last netid for this block

Example

  • Netid 180.8 is assigned
  • Last address is reserved
  • Recall: routers have addresses

79

slide-80
SLIDE 80

Figure Blocks in Class C

  • Class C is divided into 2,097,152 blocks (256 addresses each)
  • 256 blocks are reserved
  • First 3 bytes are the same (netid), the remaining 1 byte can change (hostids)
  • For example, Network id 192.0.0 covers addresses 192.0.0.0 to 192.0.0.255

80

slide-81
SLIDE 81

Figure The single block in Class D

Class D addresses are made of one block, used for multicasting.

81

slide-82
SLIDE 82

Figure The single block in Class E

The only block of class E addresses was reserved for future purposes.

82

slide-83
SLIDE 83

The range of addresses allocated to an

  • rganization in classful addressing

was a block of addresses in Class A, B, or C.

83

slide-84
SLIDE 84

Figure Two-level addressing in classful addressing

84

slide-85
SLIDE 85

Figure Information extraction in classful addressing

netid

First address 000 ... 0

The network address is the first address. The network address defines the network to the rest of the Internet. Given the network address, we can find the class of the address, the block, and the range of the addresses in the block

85

slide-86
SLIDE 86

An An add address ress in in a blo lock ck is is gi give ven as as 73 73.22 22.17 17.25

  • 25. Find

Find the the number umber

  • f
  • f ad

addresse dresses in in the the block, block, th the firs first ad addr dress, ess, and and the the last last address ess. Soluti tion

  • n
  • 1. The

The numb umber er of

  • f addresses

addresses in in this this block block is is N = 232

32−n = 224 24

16 16,777 77,21 216.

  • 2. To

To find the first st address, ss, we we keep the leftm tmost

  • st 8 bits and

and set set the the ri rightm ghtmost

  • st

24 24 bits its all all to to 0s. The The first first add address ress is is 73 73.0.0.0/8, in in wh which 8 is is the value of

  • f n.
  • 3. To

To find the last address, ess, we we keep the leftmo tmost st 8 bits and and set set the the ri right ghtmost most 24 24 bits its all all to to 1s. Th The last ast ad address dress is is 73 73.255 55.25 255.255 55/8.

Example 9

86

slide-87
SLIDE 87

Figure Solution to Example 9

87

slide-88
SLIDE 88

An An add address ress in in a bl block

  • ck is

is gi give ven as as 18 180.8.17 17.9. Fi Find the the number number

  • f
  • f ad

addresse dresses in in the the block, block, th the firs first ad addr dress, ess, and and the the last last address ess. Soluti tion

  • n
  • 1. The

The numb umber er of

  • f addresses

addresses in in this this block block is is N = 232

32−n = 216 16

65 65,536 36.

  • 2. To

To find the first st address, ess, we we keep the leftm tmost

  • st 16

16 bits and and set set the the ri rightm ghtmost

  • st

16 16 bits its all all to to 0s. The The first first add address ress is is 18 18.8.0.0/16 16, in in which 16 16 is is the value of

  • f n.
  • 3. To

To find the last address, ess, we we keep the leftmo tmost st 16 16 bits and and set set the the ri right ghtmost most 16 16 bits its all all to to 1s. Th The last ast ad address dress is is 18 18.8.25 255.255 55/16 16.

Example 10

88

slide-89
SLIDE 89

Figure Solution to Example 10

89

slide-90
SLIDE 90

An An add address ress in in a blo lock ck is is gi give ven as as 200 200.11 11.8.45

  • 45. Find

Find the the number umber

  • f
  • f ad

addresse dresses in in the the block, block, th the firs first ad addr dress, ess, and and the the last last address ess. Soluti tion

  • n
  • 1. The

The number er of

  • f addresses

sses in in this is blo lock is is N = 232

32−n = 28= 256

256.

  • 2. To

To find the first st address, ess, we we keep the leftm tmost

  • st 24

24 bits and and set set the the ri right ghtmost most 8 bits its all all to to 0s. The The firs first address dress is is 200 200.11 11.8.0/24 24, in in wh which 24 24 is is the value of

  • f n.
  • 3. To

To find the last address, ess, we we keep the leftmo tmost st 24 24 bits and and set set the the right rightmost most 8 bits its all all to to 1s. The The last last ad address dress is is 200 200.11 11.8.255 55/24 24.

Example 11

90

slide-91
SLIDE 91

Figure Solution to Example 11

91

slide-92
SLIDE 92

92

Figure Sample Internet

slide-93
SLIDE 93

Figure Network addresses

93

slide-94
SLIDE 94

Network mask

  • Given the network address, we can easily determine the block and range of

addresses

  • Suppose given the IP address, can we determine the network address (beginning
  • f the block) ?
  • To route packets to the correct network, a router must extract the network

address from the destination IP address

  • How would we EXTRACT the network address from the IP address? We would

use a MASK.

A mask is a 32-bit binary number that gives the first address in the block (the network address) when bitwise ANDed with an address in the block.

94

slide-95
SLIDE 95

Figure Network mask

95

slide-96
SLIDE 96

Figure Finding a network address using the default mask

  • If bit is ANDed with 1, it’s preserved
  • If bit is ANDed with 0, it’s changed to a 0.

A simple way to determine the netid for un-subnetted cases: (1) if mask byte is 255, retain corresponding byte of the address, (2) if mask byte is 0, set corresponding address byte to 0.

96

slide-97
SLIDE 97

A router router rec recei eives es a pack packet et with ith the the destin estinatio ation ad address dress 181 81.24 24.67 67.32

  • 32. Sh

Show how how the the rout router er fi find nds the the ne network twork ad address dress of

  • f

the packet et. Soluti tion

  • n

Si Since nce the the class lass of

  • f the

the add ddress ress is is B, B, we we assu assume me that that the the router router app pplie ies the the defau default lt mask ask for for cl class ass B, B, 25 255.255 255.0.0 to to find find the the networ work address ss.

Example 12

97

slide-98
SLIDE 98

Recall IP Addresses: Classful Addressing

Class # of addresses Percent of the Space A 231=2147483648 50% B 230=1073741824 25% C 229=536870912 12.5% D 228=268435456 6.25% E 228=268435456 6.25%

98

slide-99
SLIDE 99

5-bit Address Space Illustration

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

No Netid case 32 addresses/block Number of blocks: 1 Address range per block: 0 to 31 Netids: N/A Network Addresses : 00000 Broadcast Addresses: 11111

99

slide-100
SLIDE 100

5-bit Address Space Illustration

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

1-bit Netid case 16 addresses/block Number of blocks: 2 Address range per block: 0 to 15 Netids: 0, 1 Network Addresses : 00000, 10000 Broadcast Addresses: 01111, 11111

100

slide-101
SLIDE 101

5-bit Address Space Illustration

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

2-bit Netid Case 8 addresses/block Number of blocks: 4 Address range per block: 0 to 7 Netids: 00, 01, 10, 11 Network Addresses : 00000, 01000, 10000, 11000 Broadcast Addresses: 00111, 01111, 10111, 11111

101

slide-102
SLIDE 102

5-bit Address Space Illustration

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

3-bit Netid Case 4 addresses/block Number of blocks: 8 Address range per block: 0 to 3 Netids: 000, 001, 010, 011, 100, 101, 110, 111 Network Addresses : 00000, 00100, 01000, 01100 10000, 10100, 11000, 11100 Broadcast Addresses: 00011, 00111, 01011, 01111 10011, 10111, 11011, 11111

102

slide-103
SLIDE 103

Mixing 3-bit & 2-bit Cases

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

4 addresses/block and 8 addresses/block Number of blocks: 6 Address range per block: 0 to 3 and 0 to 7 Netids: 000, 001, 010, 011, 10, 11 Network Addresses : 00000, 00100, 01000, 01100 10000, 11000 Broadcast Addresses: 00011, 00111, 01011, 01111 10111, 11111

103

slide-104
SLIDE 104

Subnetting

 When we talked about CLASSFUL addressing – we realized the problem of wasted host addresses and depleting available network addresses.  In subnetting, a network is divided into several smaller networks called subnetworks or subnets – each subnet will have it’s own address  Typically, there are 2 steps in reaching a destination: first we must reach the network (netid) and then we reach the destination (hostid)

104

slide-105
SLIDE 105

A network with two levels of hierarchy (not subnetting)

 The 2 level approach is not enough some times – you can

  • nly have 1 physical network – in example, all host are at

the same level – no grouping

105

slide-106
SLIDE 106

A network with three levels of hierarchy (subnetted)

106

slide-107
SLIDE 107

Addresses in a network with and without subnetting

With subnetting, there are 3 levels (versus 2 levels). Partition the hostid space into subnetid and hostid. (1st) network, (2nd) subnetwork and (3rd) host

107

slide-108
SLIDE 108

Figure Network mask and subnetwork mask

108

slide-109
SLIDE 109

Similar to Hierarchy concept in a telephone number

109

slide-110
SLIDE 110

Default mask and subnet mask

110

slide-111
SLIDE 111

A cl class ass B network etwork can can be be di divid ided in into to fou four subnet subnetwo works

  • rks. The

The valu lue of

  • f n = 16

16 and and the valu lue of

  • f

n1 = n2 = n3 = n4 = 16 + log24 = 18. This means that at the subnet mask has has eighteen een 1s and nd fourt fourteen en 0s. In In

  • ther
  • ther

words

  • rds,

th the sub subnet net mask mask is is 255 55.25 255.192 192.0 which which is is di different ferent fr from

  • m the

the ne network twork mask mask for for class B (255 255.255 55.0.0).

Example 13

111

slide-112
SLIDE 112

A cl class ass B network etwork is is divid ivided ed into nto four four sub subnets

  • nets. Si

Sinc nce one of

  • f the

the add ddress resses es in in subn subnet et 2 is is 141 41.14 14.120 20.77 77, we we can can find find th the subn subnet et address ess as as:

Example 14

The The valu values es of

  • f the

the first, first, seco second, d, and fourth fourth bytes ytes are are calcu calcula lated ted us using ng the the first first short short cut cut for for AND ND op

  • perat

eratio

  • ion. The value

value of

  • f the

the third third byte byte is is ca calcul lculated ated us using ing the the seco second nd sh short

  • rt cut

cut for for the the AND AND

  • peratio

ation.

112

slide-113
SLIDE 113

Example 15 What is the subnetwork address if the destination address is 200.45.34.56 and the subnet mask is 255.255.240.0?

Solution Address: 11001000 00101101 00100010 00111000 Mask: 11111111 11111111 11110000 00000000 AND: 11001000 00101101 00100000 00000000 The subnetwork address is 200.45.32.0.

113

slide-114
SLIDE 114

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

1-bit Netid case (no subnets) 16 addresses/block Number of blocks: 2 Address range per block: 0 to 15 Netids: 0, 1 Network Addresses : 00000, 10000 Broadcast Addresses: 01111, 11111

Recall - 5-bit Address Space Illustration

114

slide-115
SLIDE 115

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

1-bit Subnet case Number of blocks/networks: 2 Number subnets per block: 2 8 addresses/subnet Address range per subnet: 0 to 7 Subnet ids: 0, 1 Network Addresses : 00000, 01000, 10000, 11000 Broadcast Addresses: 00111, 01111, 10111, 11111

5-bit Address Space Illustration

115

slide-116
SLIDE 116

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

2-bit Subnet case Number of blocks/networks: 2 Number subnets per block: 4 4 addresses/subnet Address range per subnet: 0 to 3 Subnet ids: 00, 01, 10, 11 Network Addresses : 00000, 00100, 01000, 01100 10000, 10100, 11000, 11100 Broadcast Addresses: 00011, 00111, 01011, 01111 10011, 10111, 11011, 11111

5-bit Address Space Illustration

116

slide-117
SLIDE 117

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

What is the mask ?

Illustrating the mask concept (1 of 3)

117

slide-118
SLIDE 118

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Illustrating the mask concept (2 of 3)

What is the mask (subnet mask) ?

118

slide-119
SLIDE 119

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Illustrating the mask concept (3 of 3)

What is the mask (subnet mask) ?

119

slide-120
SLIDE 120

The number of subnets must be a power of 2. Determine the number of subnets added by looking at the number

  • f 1s added to the default mask and performing 2 raised to that

number For example, 23 = 8 subnets

120

slide-121
SLIDE 121

A company is granted the site address 201.70.64.0 (class C). The company needs six subnets. Design the subnets.

Solution

The number

  • f

1s in the default mask is 24 (class C). The company needs six subnets. This number 6 is not a power of 2. The next number that is a power of 2 is 8 (23). We need 3 more 1s in the subnet mask. The total number

  • f 1s in the subnet mask is 27 (=24 + 3).

The total number of 0s is 5 (=32 - 27). The mask would be

Example 16

121

slide-122
SLIDE 122

11111111 11111111 11111111 11100000

  • r

255.255.255.224 The number of subnets is 8. The number of addresses in each subnet is 25 (5 is the number of 0s) or 32. Example 16 Solution (Continued)

122

slide-123
SLIDE 123

Example 16 (Solution Continued)

123

slide-124
SLIDE 124

A company is granted the site address 181.56.0.0 (class B). The company needs 1000 subnets. Design the subnets. Solution

The number of 1s in the default mask is 16 (class B). The company needs 1000 subnets. This number is not a power of 2. The next number that is a power of 2 is 1024 (210). We need 10 more 1s in the subnet mask. The total number of 1s in the subnet mask is 26 (=16 + 10). The total number of 0s is 6 (=32 - 26). The mask is 11111111 11111111 11111111 11000000

  • r

255.255.255.192. The number of subnets is 1024. The number of addresses in each subnet is 26 (6 is the number of 0s) or 64.

Example 17

124

slide-125
SLIDE 125

Subtract 63 from 255 to get 192

Example 17 (Solution Continued)

125

slide-126
SLIDE 126

Subnets

IP address:

  • subnet part - high order

bits

  • host part - low order

bits

what’s a subnet ?

  • device interfaces with

same subnet part of IP address

  • can physically reach

each other without intervening router

network consisting of 3 subnets

223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.9 223.1.3.2 223.1.3.1

subnet

223.1.1.2 223.1.3.27 223.1.2.2 223.1.2.1

126

slide-127
SLIDE 127
  • Although class A and B addresses are dwindling – there are

plenty of class C addresses

  • The problem with C addresses is, they only have 256 hostids –

not enough for any midsize to large size organization – especially if you plan to give every computer, printer, scanner,

  • etc. multiple IP addresses
  • Supernetting allows an organization the ability to combine

several class C blocks in creating a larger range of addresses

  • Note: breaking up a network = subnetting
  • Note: combining Class-C networks = supernetting

Supernetting

127

slide-128
SLIDE 128

Assigning or Choosing Class C Blocks

 When assigning class C block, the choices of blocks need

to follow a set of rules:

 #1 – the # of blocks must be a power of 2  #2 – blocks must be contiguous (no gaps between blocks)  #3 – the 3rd byte of the first address in the superblock must be

evenly divisible by the number of blocks – ie. if the # of blocks is N, the 3rd byte must be divisible by N

128

slide-129
SLIDE 129

Example 18

A company needs 600 addresses. Which of the following set of class C blocks can be used to form a supernet for this company?

  • a. 198.47.32.0

198.47.33.0 198.47.34.0

  • b. 198.47.32.0

198.47.42.0 198.47.52.0 198.47.62.0

  • c. 198.47.31.0

198.47.32.0 198.47.33.0 198.47.34.0

  • d. 198.47.32.0

198.47.33.0 198.47.34.0 198.47.35.0

Solution

a: No, there are only three blocks. Must be a power of 2 b: No, the blocks are not contiguous. c: No, 31 in the first block is not divisible by 4. d: Yes, all three requirements are fulfilled. (1. Power of 2, 2. Contiguous and 3. 3rd byte of 1st address is divisible by 4: 32/4=8)

129

slide-130
SLIDE 130

Example 19

A supernet has a first address of 205.16.32.0 and a supernet mask of 255.255.248.0. How many blocks are in this supernet and what is the range of addresses? Solution

  • The default mask has 24 1s because 205.16.32.0 is a class C.
  • Because the supernet mask is 255.255.248.0, the supernet has 21 1s.
  • Since the difference between the default and supernet masks is 3, there are

23 or 8 blocks in this supernet.

  • Because the blocks start with 205.16.32.0 and must be contiguous, the

blocks are 205.16.32.0, 205.16.33.0, 205.16.34.0………. 205.16.39.0.

  • The first address is 205.16.32.0. The last address is 205.16.39.255.
  • The total number of addresses is 8 x 256 = 2048

130

slide-131
SLIDE 131

Explain Supernetting Conceptually

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Back

  • ut

this bit from netid into host id

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Causes these 2 blocks to combine as a single block 131

slide-132
SLIDE 132

Figure Comparison of subnet, default, and supernet mask

132

slide-133
SLIDE 133

Classless Addressing

Variable-length blocks are used that

belong to no classes.

133

slide-134
SLIDE 134

Figure Variable-length blocks in classless addressing

 the number of addresses in a block; it must be a power of 2 (20, 21, 22, 23, . . .).

134

slide-135
SLIDE 135

Figure Prefix and suffix

In classless addressing, the prefix defines the network and the suffix defines the host.

135

slide-136
SLIDE 136

What What is is the the prefix prefix length length an and su suff ffix length length if if the the wh whole In Inter ternet et is is considere idered as as one

  • ne sin

ingle le blo lock wi with 4,294 294,967 67,296 96 addresses? esses? Soluti tion

  • n

In In this this case, case, the the prefi prefix length length is is 0 an and the the suff uffix ix le length gth is is 32

  • 32. All

All 32 32 bits its var vary to to de defi fine ne 232

32 = 4,294

294,967 67,296 296 hosts

  • sts in

in th this is sing single le block.

Example 20

136

slide-137
SLIDE 137

What What is is th the prefix prefix len ength gth an and suff suffix ix leng ength th if if the the In Inter ternet net is is divid ivided ed in into 4,294 294,967 967,296 96 blo locks cks and and ea each ch block lock has as on

  • ne

single address? ss? Soluti tion

  • n

In In th this is case case, the the pr prefix efix len length gth for for each ach blo lock ck is is 32 32 and and the the suf suffix fix length ngth is is 0. All ll 32 32 bi bits ts ar are neede needed to to defin define 232

32 = 4,29

294,967 67,29 296 blocks

  • cks. Th

The on

  • nly

ly add address ress in in each each blo lock ck is is defin efined ed by by the the block block itsel elf.

Example 21

137

slide-138
SLIDE 138

Figure Slash notation

Th The number number of

  • f add

addresses resses in in a block block is is inv invers ersely ly related related to to the the val value ue of

  • f the

the prefix prefix length, length, n. A sma mall ll n means means a larger larger block block; a large n means a small block.

138

slide-139
SLIDE 139

The The followin wing addresses sses are defined ed using slash notati ation

  • ns.
  • a. In

In the the ad address dress 12 12.23 23.24 24.78 78/8, the the netwo network rk mask ask is is 255 255.0.0.0. Th The mask mask has as eig ight ht 1s and nd twe twenty nty-four four 0s. Th The prefix prefix length length is is 8; the suff ffix length th is is 24 24.

  • b. In

In the the address ddress 13 130.11 11.23 232.156 56/16 16, the the networ etwork mask mask is is 255 55.25 255.0.0. The The ma mask sk has has sixt sixteen en 1s an and sixtee sixteen 0s.The The prefi fix length th is is 16 16; the suffix ffix length is is 16 16.

  • c. In

In the the address ddress 16 167.199 199.170 170.82 82/27 27, the the networ network mask mask is is 255 55.25 255.255 255.224

  • 24. The

The mask mask has has tw twenty enty-se seve ven 1s and and five five

  • 0s. The

The prefix fix length th is is 27 27; the suff ffix length is is 5.

Example 22

139

slide-140
SLIDE 140

Given en an an addresses sses using slash notatio ations ns: a.

  • a. The

The number er of

  • f addresses

sses in in the block: N = 232

32 - n

b.

  • b. Fir

irst st address ess: (the he given address) ss) AND AND (netwo twork rk mask) c.

  • c. Last address

ss: (the he given address) ss) OR OR [NOT NOT (netw twork

  • rk mask)]

)]

Extracting Block Information

140

slide-141
SLIDE 141

One One of

  • f the

the address ddresses es in in a bl block

  • ck is

is 167 167.19 199.170 70.82 82/27

  • 27. Fin

ind the the numbe umber of

  • f add

ddress resses es in in the the ne network, twork, the the first first ad addr dress, ess, and and the the last address ess. Soluti tion

  • n

The The value value of

  • f n is

is 27

  • 27. The

The ne network twork mask mask has as tw twen enty ty-seven seven 1s and and five 0s. It It is is 255 255.255 55.25 255.240 240.

  • a. The

The number er of

  • f addresses

sses in in the networ work is is 232

32 − n = 32

32.

  • b. We

We use the AND AND operat ation to to find the first rst address ess (n (network etwork address) ess). The The first rst address ess is is 167 167.19 199.170 170.64 64/27 27.

Example 23

141

slide-142
SLIDE 142
  • c. To

To find the last address, ss, we we first st find the complem lement ent of

  • f

the the network work mask and and then OR OR it it wi with the giv iven address ess: The The last last address ess is is 167 167.199 99.17 170.95 95/27 27.

Example 23 Continued

142

slide-143
SLIDE 143

One One of

  • f the

the add addresses esses in in a block block is is 17 17.63 63.11 110.114 114/24

  • 24. Fin

ind the the numbe umber of

  • f add

ddress resses, es, the the first first address, address, and and the the last last ad address dress in in the block. Soluti tion

  • n

The The network

  • rk mask is

is 255 255.255 55.255 255.0.

  • a. The

The number er of

  • f addresses

sses in in the networ work is is 232

32 − 24 24 = 256

256.

  • b. To

To fin find the the first first address, ddress, we we use use th the short short cu cut me metho thods ds di disc scusse ussed early arly in in the the cha chapter pter. Th The first first add address ess is is 17 17.63 63.110 10.0/24 24.

Example 24

143

slide-144
SLIDE 144

c.

  • c. To find the last address,

ss, we we use the comple leme ment nt of the network work mask k and the fir irst st short rt cut t method hod we we discussed ssed before.

  • efore. The last address

ess is 17.63.11 63.110. 0.255/24. 55/24.

Example 24 Continued

144

slide-145
SLIDE 145

One One of

  • f the

the add addresses esses in in a block block is is 110 110.23 23.120 20.14 14/20

  • 20. Fin

ind the the number umber of

  • f address

ddresses, es, the the first first ad address, dress, and and the the last ast add address ress in in the block. Soluti tion

  • n

The The network

  • rk mask is

is 255 255.255 55.24 240.0.

  • a. The

The number er of

  • f addresses

sses in in the networ work is is 232

32 − 20 20 = 4096

4096.

  • b. To

To fi find nd the the first first add ddress, ress, we we apply pply the firs first sh short

  • rt cut

cut to to bytes bytes 1, 2, an and 4 and and the the second second short short cut ut to to by byte te 3. The The first st address ss is is 110 110.23 23.112 112.0/20 20.

Example 25

145

slide-146
SLIDE 146

c.

  • c. To find the last address,

ss, we we apply the first st short rt cut to bytes es 1, 2, and 4 and the second d short rt cut to byte e 3. The OR R operati ation

  • n is applied to the complement

ement of the mask. k. The last t address dress is 110.2 .23. 3.127.25 27.255/ 5/20. 0.

Example 25 Continued

146

slide-147
SLIDE 147

Three ee restr strict ction

  • ns needed

needed to to be be applied to to the allocate ated block: a.

  • a. The

The nu number mber of

  • f reque

requeste sted address addresses, es, N, needs eeds to to be be a powe wer of

  • f 2.
  • b. The

The va valu lue of

  • f pre

prefix fix length, ngth, n, n, can be be fou found nd fr from

  • m the

the number umber

  • f
  • f addresses

esses in in the blo lock. n = 32 32 – log2N

  • c. The

The be begi ginning ing ad addr dress ess needs needs to to be be divis ivisibl ible by by the the number umber of

  • f

addresses esses of

  • f the blo

lock.

  • For example, if a block contains 4 addresses, the beginning address

must be divisible by 4. If the block has less than 256 addresses, we need to check only the rightmost byte. If it has less than 65,536 addresses, we need to check only the two rightmost bytes, and so on

Block Allocation

147

slide-148
SLIDE 148

Wh Which ich of

  • f the

the fol follow lowin ing can can be be the the begin beginning ing add address ress of

  • f a bl

block

  • ck

that at contai tains ns 16 16 addresse esses? s? a.

  • a. 123

123.45 45.24 24.52 52 b. 205 205.16 16.37 37.32 32 c. 190 190.16 16.42 42.44 44 d. 17 17.17 17.33 33.80 80

Example 26

Solution The address 205.16.37.32 is eligible because 32 is divisible by 16. The address 17.17.33.80 is eligible because 80 is divisible by 16.

148

slide-149
SLIDE 149

Whic Which of

  • f the

the fol

  • llowin

lowing can an be be the the begin beginning ing addres address of

  • f a bloc

block that that co contains ntains 1024 24 address dresses? es? a. a. 205 205.16 16.37 37.32 32

  • b. 190

190.16 16.42 42.0

  • c. 17

17.17 17.32 32.0

  • d. 123

123.45 45.24 24.52 52

Example 27

Solution

  • To be divisible by 1024, the rightmost byte of an address should be 0 because any value in that

first byte will be a fraction of 1024 (ie. 0 to 255).

  • To be divisible by 1024, the rightmost byte should be 0 and the second rightmost byte must be

divisible by 4 because for every unique number in the second byte position, there exist 256 addresses in the first byte position that maps to it. To get 1024 addresses overall, you will need an increment of 4 in the 2nd byte position.

  • Therefore, the 2nd byte needs to be divisible by 4.
  • Only the address 17.17.32.0 meets this condition.

149

slide-150
SLIDE 150

150

slide-151
SLIDE 151

An An orga

  • rgani

nizati zation

  • n is

is gr granted anted th the blo lock ck 13 130.34 34.12 12.64 64/26

  • 26. The

The

  • r
  • rganiz

ganization ation ne needs eds four four sub subnetwo networks, rks, each each with with an an eq equa ual number umber

  • f
  • f

hosts hosts. De Design gn the the sub subnetwo networks rks an and find find the the information rmation about about each networ work. Soluti tion

  • n

Th The num number ber of

  • f add

addresses esses for for the the who whole netwo network rk can can be be found found as as N = 232

32 − 26 26 = 64

  • 64. The

The fi first rst add address ress in in the the netw etwork

  • rk is

is 130 30.34 34.12 12.64 64/26 26 and and the the la last st ad addr dress ess is is 130 130.34 34.12 12.127 127/26

  • 26. We

We now now design the subnetw etworks

  • rks:
  • 1. We

We grant grant 16 16 ad addr dress esses es for for each ach sub subnetw network

  • rk to

to meet meet the the first st requirem rement ent (64 64/16 16 is is a powe wer of

  • f 2).
  • 2. The

The subnetwork etwork mask for each subnetwo etwork rk is is:

Example 28 --- Subnetting

151

slide-152
SLIDE 152

3.

  • 3. We grant

nt 16 addresse esses s to each subnet et starting arting from

  • m the

first st available ble address.

  • ess. The followin

wing g Figure e shows ws the subblock ck for r each subnet.

  • et. No

Note that at the starting rting address ess in each subnetwo etwork rk is divisible ble by the number er of addresse esses s in that at subnetwo etwork. rk.

Example 28 Continued

152

slide-153
SLIDE 153

Figure Solution to Example 28

153

slide-154
SLIDE 154

An organizat nization

  • n is grante

nted d a bl block of addresse esses s wi with the beginning ng address ss 14.24.74.0/24. 24.74.0/24. The organiza izati tion

  • n needs to

have 3 subblocks cks of addresse esses s to use in it its thre ree e subnets ets as shown wn below: w: ❑ One subblock

  • ck of 120 addresse

esses. s. ❑ One subblock

  • ck of 60 addresses.

sses. ❑ One subblock

  • ck of 10 addresses.

sses. So Solu luti tion

  • n

There re are 232 − 24 = 256 addresses sses in t this s block.

  • k. The first

st address ess is 14.24.74.0/24; 24.74.0/24; the last address ss is 14.24.7 24.74. 4.255/24. 55/24. a.

  • a. The number

er of addresses sses in t the first st subblock ck is not a powe wer of 2. We all llocate ate 128 128 addresses sses. . The subnet et mask k is 25. The first rst address ess is 14.24.74.0/25; 24.74.0/25; the last address ss is 14.24.74.1 24.74.127/25. 27/25.

Example 29

154

slide-155
SLIDE 155

b.

  • b. The number

er of addresses sses in t the second nd subblock ck is not a a powe wer of 2 ei either.

  • er. We allocate

ate 64 64 addresses.

  • sses. The subnet

et mask k is 26. The first st address ss in t this s block is 14.24. 4.74.128/2 4.128/26; ; the last t address ess is 14.24.74.1 24.74.191/26. 91/26. c.

  • c. The number

r of addresse esses s in the third rd subblock ck is not a powe wer of 2 ei either.

  • er. We allocate

ate 16 16 addresses.

  • sses. The subnet

et mask k is 28. The first rst address ess in t this s block k is 14.24. 4.74. 4.192 92/28; /28; the la last t address ss is is 14.24. 4.74. 4.207 07/28. /28. d.

  • d. If

f we we ad add all addresse esses s in the previ vious us subblocks cks, , the result lt is 208 addresses, sses, wh which means 48 48 addresse esses s are left ft in reserve.

  • rve. The first

rst address ess in t this s range e is 14.24. 4.74.20 4.209. . The la last t address ess is is 14.24.74.255. 4.74.255. e.

  • e. Figure

re 5.31 1 shows ws the confi figurati guration

  • n of blocks.
  • s. We have

shown wn the first rst address ess in each block. k.

Example 29 Continued

155

slide-156
SLIDE 156

Figure Solution to Example 29

156

slide-157
SLIDE 157

Assume ume a co compa pany ny has three ree offi fices: ces: Ce Centr tral, l, East, t, and West. st. The Ce Central ral offi fice ce is connect cted d to the East t and West st offi fices ces via private, ate, WAN N lines. . The compan any y is grante nted d a bl block of 64 addresse esses s wi with the beginning ng address ess 70.12.10 12.100.128/2 0.128/26.

  • 6. The

manage gement ment has decided d to allocate ate 32 addresses sses for the Ce Central ral offi fice ce and divides s the rest t of addresse esses s betwee ween n the two wo

  • ther

er offi fice ces. s. 1.

  • 1. The number

er of addresses sses are assig igned ned as foll llows: ws:

Example 30

  • 2. We can find the prefi

efix x length h for r each subnetwo etwork: rk:

157

slide-158
SLIDE 158
  • 3. Figure

re 5.32 2 shows ws the confi figurati guration

  • n designed

ed by the manage gement.

  • ment. The Ce

Central ral offi fice ce uses s addresse esses s 70.12. 2.100.12 00.128/ 8/27 to 70.12.10 2.100. 0.159/27 59/27. . The compan any y has used thre ree e of these se addresses sses for the router ters s and has reserve erved d the last t address ess in t the subblock ck. . The East t offi fice ce uses the addresses sses 70.12.10 12.100. 0.160/2 60/28 to 70.12. 2.100.17 00.175/ 5/28. . One

  • f these

se addresse esses s is used for the router ter and the compan any y has reserve erved d the la last t address ss in in the subblo lock

  • ck. The West

st offi fice ce uses the addresses sses 70.12.10 12.100. 0.176/28 76/28 to 70.12. 2.100.19 00.191/ 1/28. . One of these se addresse esses s is used for r the router ter and the company ny has reserve erved d the last t address ss in t the subblock ck. . The company any uses no address ss for r the poin int-to to-point

  • int connect

ctions ions in in WAN ANs. s.

Example 30 Continued

158

slide-159
SLIDE 159

Figure Example 30

159

slide-160
SLIDE 160

An ISP is grante nted d a bl block of addresse esses s startin arting g wi with 190.100 100.0. .0.0/16 0/16 (65,5 5,536 36 addresses). sses). The ISP needs to distr tribute bute these se addresse esses s to thre ree e groups s of custom tomers ers as follows:

  • ws:

❑ The first st group has 64 custom tomers; ers; each needs approximatel ximately y 256 addresse esses. s. ❑ The second d group has 128 custo stomer mers; s; each needs approxi proximatel mately y 128 addresses. esses. ❑ The thir ird group has 128 customers; tomers; each needs approxim

  • ximatel

ately y 64 addresses. sses. We design the subblocks cks and find out how w many addresse esses s are still available ble after ter these se allocati ation

  • ns.

s.

Example 31 --- Supernetting

160

slide-161
SLIDE 161

Soluti tion

  • n

Let us solve the problem em in t two wo step eps.

  • s. In the first

st step, p, we we allocate ate a subblock ck of addresses sses to each group.

  • p. The total

tal number er of addresses sses allocated ted to each group and the prefix fix length th for r each subblock ck can found d as

Example 31 Continued

Figure re 5.33 3 shows ws the design for r the first rst hierarch archical cal level. . Fig igure re 5.34 4 shows ws the second nd le level l of the hie ierarch archy.

  • y. No

Note that t we we have used the first st address ss for r each custom tomer er as the subnet et address ess and have reserve erved d the last t address ss as a special al address. ess.

161

slide-162
SLIDE 162

Figure Solution to Example 31: first step

162

slide-163
SLIDE 163

Figure Solution to Example 31: second step

163

slide-164
SLIDE 164

Special Addresses

In In cl classful assful addressing addressing so some me add addre ress sses es wer were re rese serv rved ed for for sp spec ecia ial pur urpo pose ses. The The cl clas assl sles ess ad addr dres essi sing ng sc sche heme me in inher erits its so some of

  • f the

these se spec specia ial addres esses ses from classful ssful addressi essing ng.

164

slide-165
SLIDE 165

 Special Blocks All-Zeros Address All-Ones Address: Limited Broadcast Address Loopback Addresses Private Addresses Multicast Addresses

165

slide-166
SLIDE 166

Figure Example of using the all-zeros address

Source: 0.0.0.0 Destination: 255.255.255.255 Packet

166

  • An address of all 0’s is used during bootstrap time if the host

doesn’t know it’s IP address. The un-named host sends an all 0 source address and limited broadcast (all 1’s) destination address to the bootstrap server (DHCP server).

slide-167
SLIDE 167

221.45.71.20/24 221.45.71.178/24 221.45.71.64/24 221.45.71.126/24 Network

Figure Example of limited broadcast (all-ones) address

167

  • An host want to send a message to every other host
  • The broadcast are confined to the local network
slide-168
SLIDE 168

Example of this host on this address Example of specific host on this network

An address of all 0’s is used during bootstrap time if the host doesn’t know it’s IP address. The un-named host sends an all 0 source address and limited broadcast (all 1’s) destination address to the bootstrap server. An address with a netid of all 0’s is used by a host or router to send another host with in the same network a message. Host sending to some other specific host on a network IP-less Host sending message to bootstrap server

168

slide-169
SLIDE 169

Figure Example of loopback address

  • The IP address with the 1st byte equal to 127 (127.0.0.0) is used for the loop back

address.

  • Loopback address is used to test software on a machine – the packet never leaves the

machine – it returns to the protocol software

  • Example: a “ping” command can send a packet with a loopback address as the

destination address to see if the IP software is capable of receiving and processing a packet.

169

slide-170
SLIDE 170
  • Multicast addresses:
  • 224.0.0.0/4 is reserved for multicast communication.

170

  • Private addresses:
  • They are not recognized globally.
slide-171
SLIDE 171

221.45.71.0/24

221.45.71.20/24 221.45.71.178/24 221.45.71.64/24 221.45.71.126/24

Network:

Figure Example of a directed broadcast address

Packet

171

slide-172
SLIDE 172

Example of direct broadcast address Example of limited broadcast address

If the hostid is all 1’s, it’s called a “broadcast address” and the router use it to send a packet to all host in a specific network. In this case, hosts 20, 64, 126 and

  • etc. will receive the packet from

the router If the hostid and netid are all 1’s, it’s called a “limited broadcast address”. If the host wants to send a packet to all host in a specific network, it would use this address. The router would block this address so that data stays contained within a specific network. Router sending to all hosts on a network Host sending to all other hosts on a network

172

slide-173
SLIDE 173

IP addresses: how to get one?

Q: How does a host get IP address?

  • The IP address of the computer
  • The subnet mask of the computer
  • The IP address of a router
  • The IP address of a name server

 hard-coded by system admin in a file

  • Windows: control-panel->network->configuration-

>tcp/ip->properties

  • UNIX: /etc/rc.config

 DHCP: Dynamic Host Configuration Protocol:

dynamically get address from as server

  • “plug-and-play”

173

slide-174
SLIDE 174

DHCP: Dynamic Host Configuration Protocol

goal: allow host to dynamically obtain its IP address from network

server when it joins network

  • can renew its lease on address in use
  • allows reuse of addresses (only hold address while

connected/“on”)

  • support for mobile users who want to join network (more

shortly)

DHCP overview:

  • host broadcasts “DHCP discover” msg [optional]
  • DHCP server responds with “DHCP offer” msg [optional]
  • host requests IP address: “DHCP request” msg
  • DHCP server sends address: “DHCP ack” msg

174

slide-175
SLIDE 175

DHCP client-server scenario

223.1.1.0/24 223.1.2.0/24 223.1.3.0/24

223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.9 223.1.3.2 223.1.3.1 223.1.1.2 223.1.3.27 223.1.2.2 223.1.2.1

DHCP server arriving DHCP client needs address in this network

175

slide-176
SLIDE 176

DHCP server: 223.1.2.5 arriving client

DHCP discover src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654 DHCP offer src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 654 lifetime: 3600 secs DHCP request src: 0.0.0.0, 68 dest:: 255.255.255.255, 67 yiaddrr: 223.1.2.4 transaction ID: 655 lifetime: 3600 secs DHCP ACK src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 655 lifetime: 3600 secs

DHCP client-server scenario

Broadcast: is there a DHCP server out there? Broadcast: I’m a DHCP server! Here’s an IP address you can use Broadcast: OK. I’ll take that IP address! Broadcast: OK. You’ve got that IP address!

176

slide-177
SLIDE 177

DHCP: more than IP addresses

DHCP can return more than just allocated IP address on subnet:

  • address of first-hop router for client
  • name and IP address of DNS sever
  • network mask (indicating network versus host portion
  • f address)

177

slide-178
SLIDE 178

 connecting laptop needs

its IP address, addr of first-hop router, addr of DNS server: use DHCP

router with DHCP server built into router

 DHCP request encapsulated

in UDP, encapsulated in IP, encapsulated in 802.1 Ethernet

 Ethernet frame broadcast

(dest: FFFFFFFFFFFF) on LAN, received at router running DHCP server

 Ethernet demuxed to IP

demuxed, UDP demuxed to DHCP

DHCP UDP IP Eth Phy

DHCP DHCP DHCP DHCP DHCP

DHCP UDP IP Eth Phy

DHCP DHCP DHCP DHCP DHCP

DHCP: example

178

slide-179
SLIDE 179

 DHCP server formulates

DHCP ACK containing client’s IP address, IP address of first-hop router for client, name & IP address of DNS server

 encapsulation of DHCP

server, frame forwarded to client, demuxing up to DHCP at client

DHCP: example

router with DHCP server built into router

DHCP DHCP DHCP DHCP

DHCP UDP IP Eth Phy

DHCP

DHCP UDP IP Eth Phy

DHCP DHCP DHCP DHCP

 client now knows its IP

address, name and IP address of DSN server, IP address of its first-hop router

179

168.1.1.1

slide-180
SLIDE 180

IP addressing: the last word...

Q: how does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers http://www.icann.org/

  • allocates addresses
  • manages DNS
  • assigns domain names, resolves disputes

180

slide-181
SLIDE 181

NAT: network address translation

10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 138.76.29.7

local network (e.g., home network) 10.0.0/24 rest of Internet

datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual) all datagrams leaving local network have same single source NAT IP address: 138.76.29.7,different source port numbers

181

slide-182
SLIDE 182

motivation: local network uses just one IP address as far as outside world is concerned:

  • range of addresses not needed from ISP: just one

IP address for all devices

  • can change addresses of devices in local network

without notifying outside world

  • can change ISP without changing addresses of

devices in local network

  • devices inside local net not explicitly addressable,

visible by outside world (a security plus)

NAT: network address translation

182

slide-183
SLIDE 183

implementation: NAT router must:

  • outgoing datagrams: replace (source IP address, port #) of

every outgoing datagram to (NAT IP address, new port #) . . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr

  • remember (in NAT translation table) every (source IP address,

port #) to (NAT IP address, new port #) translation pair

  • incoming datagrams: replace (NAT IP address, new port #) in

dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table

NAT: network address translation

183

slide-184
SLIDE 184

10.0.0.1 10.0.0.2 10.0.0.3

S: 10.0.0.1, 3345 D: 128.119.40.186, 80

1

10.0.0.4 138.76.29.7

1: host 10.0.0.1 sends datagram to 128.119.40.186, 80 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 …… ……

S: 128.119.40.186, 80 D: 10.0.0.1, 3345

4

S: 138.76.29.7, 5001 D: 128.119.40.186, 80

2 2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table

S: 128.119.40.186, 80 D: 138.76.29.7, 5001

3 3: reply arrives

  • dest. address:

138.76.29.7, 5001 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345

NAT: network address translation

184

slide-185
SLIDE 185

 16-bit port-number field:

  • 60,000 simultaneous connections with a single

LAN-side address!

 NAT is controversial:

  • routers should only process up to layer 3
  • violates end-to-end argument
  • NAT possibility must be taken into account by app

designers, e.g., P2P applications

  • address shortage should instead be solved by

IPv6

NAT: network address translation

185

slide-186
SLIDE 186

NAT traversal problem

 client wants to connect to

server with address 10.0.0.1

  • server address 10.0.0.1 local to

LAN (client can’t use it as destination addr)

  • only one externally visible NATed

address: 138.76.29.7

 solution1: statically configure

NAT to forward incoming connection requests at given port to server

  • e.g., (123.76.29.7, port 2500)

always forwarded to 10.0.0.1 port 2500

10.0.0.1 10.0.0.4

NAT router

138.76.29.7

client

?

186

slide-187
SLIDE 187

NAT traversal problem

 solution 2: Universal Plug and Play

(UPnP) Internet Gateway Device (IGD) Protocol. Allows NATed host to:

 learn public IP address

(138.76.29.7)

 add/remove port mappings

(with lease times) i.e., automate static NAT port map configuration

10.0.0.1

NAT router IGD

187

slide-188
SLIDE 188

NAT traversal problem

 solution 3: relaying (used in Skype)

  • NATed client establishes connection to relay
  • external client connects to relay
  • relay bridges packets between to connections

138.76.29.7

client

  • 1. connection to

relay initiated by NATed host

  • 2. connection to

relay initiated by client

  • 3. relaying

established NAT router

10.0.0.1

188

slide-189
SLIDE 189

1 introduction 2 virtual circuit and datagram networks 3 what’s inside a router 4 IP: Internet Protocol

  • datagram format
  • IPv4 addressing
  • ICMP
  • IPv6

5 routing algorithms

  • link state
  • distance vector
  • hierarchical routing

6 routing in the Internet

  • RIP
  • OSPF
  • BGP

7 broadcast and multicast routing

Network Layer: outline

189

slide-190
SLIDE 190

ICMP: internet control message protocol

 used by hosts & routers

to communicate network- level information

  • error reporting:

unreachable host, network, port, protocol

  • echo request/reply (used by

ping)

 network-layer “above” IP:

  • ICMP msgs carried in IP

datagrams

 ICMP message: type, code

plus first 8 bytes of IP datagram causing error

Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header

190

slide-191
SLIDE 191

ICMP Encapsulation

191

slide-192
SLIDE 192

Traceroute and ICMP

 source sends series of

UDP segments to dest

  • first set has TTL =1
  • second set has TTL=2, etc.
  • unlikely port number

 when nth set of datagrams

arrives to nth router:

  • router discards datagrams
  • and sends source ICMP

messages (type 11, code 0)

  • ICMP messages includes

name of router & IP address

 when ICMP messages

arrives, source records RTTs stopping criteria:

 UDP segment eventually

arrives at destination host

 destination returns ICMP

“port unreachable” message (type 3, code 3)

 source stops

3 probes 3 probes 3 probes

192

slide-193
SLIDE 193

IPv6: motivation

 initial motivation: 32-bit address space soon to be

completely allocated.

 additional motivation:

  • header format helps speed processing/forwarding
  • header changes to facilitate QoS

IPv6 datagram format:

  • fixed-length 40 byte header
  • no fragmentation allowed

193

slide-194
SLIDE 194

IPv6 datagram format

priority: identify priority among datagrams in flow flow Label: identify datagrams in same “flow.” (concept of“flow” not well defined). next header: identify upper layer protocol for data

data destination address (128 bits) source address (128 bits) payload len next hdr hop limit flow label pri ver 32 bits

194

slide-195
SLIDE 195

Other changes from IPv4

 checksum: removed entirely to reduce processing

time at each hop

 options: allowed, but outside of header, indicated

by “Next Header” field

 ICMPv6: new version of ICMP

  • additional message types, e.g. “Packet Too Big”
  • multicast group management functions

195

slide-196
SLIDE 196

Transition from IPv4 to IPv6

 not all routers can be upgraded simultaneously

  • no “flag days”
  • how will network operate with mixed IPv4 and

IPv6 routers?

 tunneling: IPv6 datagram carried as payload in IPv4

datagram among IPv4 routers

IPv4 source, dest addr IPv4 header fields

IPv4 datagram IPv6 datagram

IPv4 payload UDP/TCP payload IPv6 source dest addr IPv6 header fields

196

slide-197
SLIDE 197

Tunneling

physical view:

IPv4 IPv4

A B

IPv6 IPv6

E

IPv6 IPv6

F C D logical view:

IPv4 tunnel connecting IPv6 routers

E

IPv6 IPv6

F A B

IPv6 IPv6

197

slide-198
SLIDE 198

flow: X src: A dest: F data

A-to-B: IPv6

Flow: X Src: A Dest: F data

src:B dest: E

B-to-C: IPv6 inside IPv4 E-to-F: IPv6

flow: X src: A dest: F data

B-to-C: IPv6 inside IPv4

Flow: X Src: A Dest: F data

src:B dest: E physical view: A B

IPv6 IPv6

E

IPv6 IPv6

F C D logical view:

IPv4 tunnel connecting IPv6 routers

E

IPv6 IPv6

F A B

IPv6 IPv6

Tunneling

IPv4 IPv4

198

slide-199
SLIDE 199

IPv6: adoption

 US National Institutes of Standards estimate [2013]:

  • ~3% of industry IP routers
  • ~11% of US gov’t routers

 Long (long!) time for deployment, use

  • 20 years and counting!
  • think of application-level changes in last 20 years: WWW,

Facebook, …

199