1 chapter 6 – internet protocol: connectionless datagram delivery 6.3 internet architecture and...

47
1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK INTERFACE (MAC) LAYER Not part of IP Chapter 12 will be about this layer Various later chapters about these

Upload: nickolas-austin

Post on 11-Jan-2016

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

1

Chapter 6 – Internet Protocol: Connectionless Datagram Delivery

6.3 Internet Architecture and Philosophy

Chapters 6 - 8 are about this layer

NETWORK INTERFACE (MAC) LAYER

Not part of IP

Chapter 12 will be about this layer

Various later chapters about these

Page 2: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

2

6.5 Connectionless Delivery System

Internet Protocol (IP) is an► unreliable (best-effort)► connectionless packet delivery service

(compare wired Ethernet)

IP

TCP

SMTP, HTTP, etc.

6.6 Purpose of the Internet Protocol

Chapter 6 – Packet format Chapter 7 – Forwarding Chapter 8 – Error messages

(but some errors are reported)

Page 3: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

3

Figure 6.3 Format of an IP Datagram

Page 4: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

4

Figure 6.3 Format of an IP Datagram

ORIGINALULTIMATE

Page 5: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

5

6.7.3 Datagram Encapsulation

Page 6: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

6

Figure 2.2 Ethernet Frame Format

0800 IP DATAGRAM

Page 7: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

7

Figure 6.7 Where Fragmentation Occurs

6.7.4 (Payload) Fragmentation

Page 8: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

8

Figure 6.8 (a) Original Datagram carrying 1400 octets of data

(b) For a network MTU of 620 the data are fragmented between

three new datagrams.

They must be complete datagrams, with header!

Page 9: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

9

Where to reassemble the payload?

How to reassemble the payload?

6.7.5 Reassembly of Fragments

Page 10: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

10

MF

1

1

0

Page 11: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

11

Page 12: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

12

Page 13: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

13

Routers make forwarding decisions.

HOST

Fig 7.1 – blue host has three possible choices when transmitting a datagram

sender

Chapter 7 IP: Forwarding IP Datagrams

Hosts also make forwarding decisions.

Page 14: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

14

7.3 Direct and Indirect Delivery of an IP Datagram

Direct: No router between source and destination

Indirect: sender must be able to identify first router in chain

Q: How does sender know that direct delivery is possible?

A: network parts of source and destination IP addresses are identical.

Page 15: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

15

Indirect delivery is a concatentation of direct deliveries;

Alternatively, direct delivery is the trivial case of indirect delivery.

Last router in chain must deliver directly

7.3.1 Datagram Delivery over a Single Network

Page 16: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

16

7.4 Table-Driven IP Forwarding

Routers store their forwarding instructions in “routing tables.”

Hosts also have routing tables, but they are small.

7.5 Next-Hop (Next-Stop?) Forwarding

A routing table contains pairs (N,R) where N is the IP address of a destination network and R is the IP address of the “next” router along the path to N.

The “next hop” must be a directly-connected router.

A router knows only the “next hop” along the way, not the complete path to the destination.

Page 17: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

17

Size of routing table is proportional to number of networks.

Fig. 7.2(b) the routing table in R

Page 18: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

18

Consequences of choosing routes based only on the destination network:

► all traffic from a source to a given destination follows the same path; multiple paths may not be followed concurrently.

► only the final router along the path can know if the destinationis operational (for Ethernet, not even the final router).

► forward and reverse paths may be different.

Routes are chosen only on basis of destination network

BHM

NO

CHL

ATL

Page 19: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

19

7.6 Default Routes

Routing table in Q:

10.0.0.0 Deliver Directly

20.0.0.0 Deliver Directly

Default Forward to

20.0.0.6

Huge benefit!

Entire external Internet can often be collapsed into a single entry!

Page 20: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

20

7.8 The IP Forwarding Algorithm

Fig 7.3

Check IP Version and checksum !

Page 21: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

21

Forwarding Algorithm (revised)

Check IP version and header checksum

Extract destination IP address, D, from the datagram;

if table contains a host-specific route for D send datagram to next-hop specified in table (ENCAPSULATE) and quit;

compute N, the network prefix of address D;

if N matches any directly-connected network addressdeliver datagram to destination D over that network (ENCAPSULATE);

else if table contains a route for network prefix Nsend datagram to next hop specified in table (ENCAPSULATE);

else if table contains a default routesend datagram to default router specified (ENCAPSULATE);

else declare a forwarding error;ENCAPSULATE = map IP address to a physical address,

encapsulate the datagram in a frame and send.

Page 22: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

22

4.11 Dotted Decimal Notation

1 0 0 0 1 0 1 0 0 0 0 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 1 0

138 . 26 . 66 . 6

compute N, the network prefix of address D;

1 0 0 0 1 0 1 0 0 0 0 1 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 1 0

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

255 . 255 . 0 . 0

“Address Mask”

Page 23: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

23

Elaboration of routing algorithm (figure 7.3, or revision):

“if table contains a route for network prefix Nsend datagram to next hop specified in table;”

Algorithm is:

For each row of the forwarding tableIf (address mask) .and. IPD = destination network IP address

then send datagram to next hop IP address exit routing algorithm.

Notation: Table row contains (destination network IP address, next hop IP address)

Recall forwarding table:

Page 24: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

24

7.9 Forwarding with IP Addresses which fields are changed by router?

Nowhere!

The router simply passes the next-hop IP address down to the network interface layer for ARP processing.

After table-lookup has determined the next-hop IP address, where in the IP datagram does the router IP layer store it?

In Destination IP Address?

Page 25: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

25

Why not use physical addresses when storing and computing routes?

01:FA:96:43:1B:49

02:16:7B:62:78:F3

Page 26: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

26

Why does IP software avoid using physical addresses when storing and computing routes?

Using only IP addresses above the dashed line makes routes easy to examine or change and hides the details of the

underlying physical networks.

Figure 7.4

Page 27: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

27

7.10 Handling Incoming Datagrams

Hosts

IP layer checks its own IP address against the destination IP address in the arriving datagram.

If match, OK

else host discards datagram.

Why discard?

► there has been an error and if host forwards thedatagram to the correct destination, error will persist;

► we don’t want the host to be diverted from its legitimate workto do the router’s work.

Page 28: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

28

7.10 Handling Incoming Datagrams – continued

Routers

Check all of own IP addresses against the destination IP address in incoming datagram.

If no match (usual situation)

router is a stop along the way from source to destination –

execute forwarding algorithm (fig 7.3)

else

router is final destination of this datagram – message is for higher layer within the router, eg. routing table change

Page 29: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

29

7.11 Establishing Routing Tables

For now, assume routing tables are loaded manually;

In chapters 13 and 15 we’ll see protocols that allow routers to learn routes from each other.

End of Chapter 7.

Page 30: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

30

Summary of Bridge 1. Like computer with 2 NICs in

promiscuous mode

2. Store and forward frames

3. Processes only valid frames

4. Works at layer 2 withhardware addresses

5. Automatically learns which destination hosts are reachable from which interface (no administrator required).

6. Does not change frame in any way (bridges “leave no

fingerprints”)

7. Forwards frames with local broadcast hardware address in destination-address field

Summary of Router 1. Like computer with 2 NICs in

normal mode

2. Store and forward IP datagrams

3. Processes only valid IP datagrams

4. Works at layer 3 with IP addresses

5. Administrator has to enter next hop in routing

tables.

6. When forwarding IP datagram, changes at least two fields in

datagram header

7. Does not forward IP datagrams with local broadcast IP address

in destination-address field

Page 31: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

31

Perspective on Comer’s Chapters 6 – 8

Chapter 6 - Internet Protocol: Connectionless Datagram Delivery

no routers necessarily involved – lab sessions 1 - 3

Chapter 7 - Internet Protocol: Forwarding IP Datagrams

how routers work – lab session 4

Chapter 8 – Internet Protocol: Error and Control Messages (ICMP)

PING in lab sessions 1 – 3, will see more in later labs.

Page 32: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

32

Chapter 8 – Internet Protocol: Error and Control Messages (ICMP)

8.2 The Internet Control Message Protocol

ICMP is a required part of IP.

Although IP does not guarantee delivery, it does not capriciously discard datagrams and when it is forced to do so it tries to be helpful by sending an ICMP message.

Both routers and hosts send ICMP messages.

Page 33: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

33

The ultimate destination of an ICMP message is the IP software on the machine intended to receive the message – it is the IP software that has the code to handle the message.

8.2 The Internet Control Message Protocol – contd.

Like all traffic across an IP network, ICMP messages travel in the payload of an IP datagram.

1

ICMP Message

Page 34: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

34

8.3 Error Reporting vs. Error Correction

Not all ICMP messages relate to errors – eg. PING.For errors, ICMP is a reporting mechanism,

not a correcting mechanism.When a datagram causes an error, the unit detecting this usually sends an ICMP message back to the original source of the datagram, stating why the datagram was dropped.

Why is notification restricted to the original source?

That’s all the

detecting unit

knows!

Page 35: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

35

Datagrams carrying ICMP messages are subject to the usual IP uncertainty.

8.4 ICMP Message Delivery

Exception: If a datagram carrying an ICMP error message encounters difficulty, an error message about this error message is not sent.

ICMP is not considered a higher-layer protocol –

it is part of IP

Page 36: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

36

8.5 ICMP Message Format

Although each ICMP message has its own format, they all begin with the same three fields:

ICMP messages that report errors always include the header plus additional octets from the IP datagram that caused the problem

Page 37: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

37

Figure 8.2 Values that can appear in the TYPE field of an ICMP message

Error?

No

Yes

Yes

Yes

?

No

?

?

Yes

Page 38: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

38

8.6 Testing Destination Reachability and Status (Ping)

Type 8 is request, type 0 reply.

IDENTIFIER is a random number, used to match replies with requests.

Will be studied in Lab Session #1

Page 39: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

39

8.8 Reports of Unreachable destinations

When a router cannot forward or deliver an IP datagram, the router sends an ICMP destination unreachable (type 3) message back to the original source.

Page 40: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

40

* Code 4 used for path MTU discovery

*

8.8 Reports of Unreachable destinations - continued

Page 41: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

41

Comer page 116:

A router may not know of all delivery failures,

eg. final delivery over Ethernet.

From revised version of routing algorithm (fig 7.3):

compute N, the network prefix of address D;

if N matches any directly-connected network addressdeliver datagram to destination D over that network

(ENCAPSULATE);

ENCAPSULATE = map IP to a physical address, encapsulate the datagram in a frame and send.

No feedback to IP if ARP fails.

Page 42: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

42

8.11 Route Change Requests from Routers

If router R2 receives a datagram that it has to forward to R1, R2 sends an ICMP redirect message (type 5) to the sending host, telling it in future to send such datagrams directly to R1.

Fig 7.1

Page 43: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

43

8.11 Route Change Requests from Routers – continued

This is not a general mechanism for route changes. It is restricted to routers sending to directly-connected hosts.

R5 cannot redirect R1 to use the shorter path from S to D

Figure 8.7

Page 44: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

44

8.12 Detecting Circular or Excessively Long Routes

Each time a router forwards a datagram it decrements the TTL by 1

If the result is zero, the router discards the datagram after sending an ICMP time exceeded (type 11, code 0) message.

When a destination host reassembles a fragmented payload, it’s possible that some fragments are lost.

When the host receives the first fragment it starts a reassembly timer.

If the timer expires before all fragments arrive, the host gives up and sends an ICMP type 11, code 1 message back to the original source.

Page 45: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

45

Page 46: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

46

Input A Input B

0 0

0 1

1 0

1 1

Output

0

0

0

1

Output A .AND. B

2 binary inputs A, B

MaskIP Destination

Address

Page 47: 1 Chapter 6 – Internet Protocol: Connectionless Datagram Delivery 6.3 Internet Architecture and Philosophy Chapters 6 - 8 are about this layer NETWORK

47

Input A Input B

0 0

0 1

1 0

1 1

Output

0

1

1

1

Output A .OR. B

2 binary inputs A, B