the network layer. responsibilities 4 addresses 4 routing 4 fragmentation and reassembly

38
The Network Layer

Upload: oswald-stevens

Post on 28-Dec-2015

220 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

The Network Layer

Page 2: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Responsibilities

Addresses

Routing

Fragmentation and reassembly

Page 3: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Network layer addresses

IP address structure (v4)

Class A |0xxxxxxx|yyyyyyyyyyyyyyyyyyyyyyyy|

Class B |10xxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy|

Class C |110xxxxxxxxxxxxxxxxxxxxx|yyyyyyyy|

Multicast|1110xxxxxxxxxxxxxxxxxxxx|yyyyyyyy|

Reserved |1111xxxxxxxxxxxxxxxxxxxx|yyyyyyyy|

Page 4: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

IP v4 Class A

Class A |0xxxxxxx|yyyyyyyyyyyyyyyyyyyyyyyy|

27 networks each with up to 224 hosts attached

Not quite. Addresses of all 0 or all 1 are special cases and not permitted for general use

Page 5: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

IP v4 Class B, C

Class B |10xxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy|

214 networks each with up to 216 hosts

– - again, not quite.

Class C |110xxxxxxxxxxxxxxxxxxxxx|yyyyyyyy|

221 networks each with up to 28 hosts (approximately)

Page 6: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Non unique addresses

Growth of the Internet has placed demands on the address space not anticipated originally. There are more machines than addresses available.

Some machines do not need a unique address, because they do not communicate over the Internet.

Addresses are set aside to be used as desired for those machines:– 10.0.0.0 - 10.255.255.255 (10/8 prefix) {Start with 10, use 8 bits}

– 172.16.0.0 - 172.31.255.255 (172.16/12 prefix)– 192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

Ref. RFC 1918

Page 7: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Network and Host addresses

The network address identifies a network comprised of multiple computers and other devices.

Routers deal with network addresses. Once the transmission reaches the right network,

the local network protocols deal with delivery to the correct machine.

The host address identifies a particular machine-to-network connection.

Page 8: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Subnets

Once upon a time, 254 hosts per network seemed pretty reasonable

That was before PCs Class C networks are not large enough for

most kinds of organizations Multiple Class C networks in a single

organization imposes management overhead

Page 9: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Subnets (2)

Subnetting allows an organization to subdivide a network internally. The internal networks continue to look like a single network from outside the organization

Take some bits from the host part of the IP address and make them part of the network part for internal routing

Page 10: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

The subnet mask Allows the routers to know how many bits are part of the

network address and how many are part of the host address Example: a class B network is subnetted so that 5 bits of

the host address are part of the network address:

10011001 1101000 00011111 00000110Network Host

Network Host

123

1 = the 32 bit address 2 = network/host division without subnetting

3 = network/host division with subnettingMask tells which bits to consider part of the network address:1 in each net address position; 0 elsewhere.Mask for the example is 11111111 11111111 11111000 00000000Dotted decimal representation: 255 255 248 0

Page 11: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Subnets (3)

The old network addresses for some of our machines Tiger: 153.104. 7.161 wild: 153.104. 1. 10 renoir: 153.104. 7.174 camille: 153.104. 7. 1 tanner: 153.104. 7.178 hawk: 153.104. 8. 50 cassel: 153.104. 7.181 smurfs: 153.104.24. 32

What class network?

153 = 10011001 => Class B network

Any indication of subnetting?

Page 12: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Current subnetting

Mendel (CSC) Within VU’s 153.104 IP address range start 200.1 IP address range end 203.254 What is the subnet mask?

255.255.252.0

Page 13: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Subnetting and DSL Some DSL providers offer static IP addresses in

groups of 8 (really?) What does that mean in terms of IP subnetting? One possibility:

– A class C network is divided among a group of subscribers. Each gets a subnet mask that allows 8 addresses.

– Addresses 000 and 111 are not legal IP addresses, though.

Page 14: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

IP v6

128 bit addresses– written as 8 parts, separated by :– each part is 6 bits, expressed in hex– (no more dotted decimal)

Notes:– space reserved for other address schemes– place to imbed the local link address– multicast, anycast, no broadcast

Page 15: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

IP V6 packet layout

Version Priority Flow Label

Payload Length Next Header Hop Limit

Source Address

Destination Address

Version = 6 Flow label = connect packets from the same sourcePayload = Packet size in bytes Next header = Next layer up connection (Protocol)Hop Limit = time to live in hops

Page 16: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Routing - Link State overview

Each routing node obtains – the information concerning the immediate

neighbors of each other node in the network– Once this information is available, the node

constructs a graphical representation of the internet

Page 17: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Routing - Link State details Enter self into table Enter data from immediate neighbors

– mark this data tentative (T) For each node marked T in the table,

examine the connection information about that node and enter it into the table.– Consider T nodes in order of cost to get there,

least costly first– Previously unknown nodes are added– Previously known nodes are examined to see if a

better route is found

Page 18: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Routing - Distance Vector Each router node knows about itself

– the distance to itself = 0• first entry in the routing table

Each router knows about its directly connected neighbors – the distance to a direct neighbor = 1

• next set of entries

Exchanging information with neighbors extends the diameter of the known universe to each router

Page 19: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Our sample network

B

C

F

H

J

K

M

A

E

D

G

I

Page 20: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

A special problem

What happens if we apply the link state protocol to the following special situation:

A B

C

1. Determine the routing table entries for each router: A, B, C

2. Assume the connection between B and C is broken

3. Show the steps by which A, B revise their tables

This is the “counting to infinity” problem

Page 21: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Border Gateway Protocol

See http://www.cisco.com/univercd/cc/td/doc/cisintwk/ics/icsbgp4.htm– For complete information on BGP

BGP is a link state protocol BGP is run between autonomous systems, rather than within

autonomous systems Instead of using a cost metric, the BGP messages contain an entire

route to the destination

Page 22: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Routing within the VU domain

153.104.0.249

...

153.104.0.18

153.104.0.19

153.104.200.1 153.104.203.1153.104.202.1153.104.201.1

153.104.0.254

153.104.0.1

Connection to our service provider

Internal routers

How would you fill in the missing numbers?

Page 23: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Routing from Renoir out1 153.104.200.1 (153.104.200.1) 0.825 ms 0.631 ms 0.590 ms 2 153.104.0.1 (153.104.0.1) 1.024 ms 0.724 ms 0.701 ms 3 153.104.0.254 (153.104.0.254) 1.053 ms 1.382 ms 1.801 ms 4 207.68.14.11 (207.68.14.11) 6.086 ms 9.067 ms 6.155 ms 5 205.171.38.85 (205.171.38.85) 8.062 ms 10.089 ms 12.455 ms 6 nyc-core-03.inet.qwest.net (205.171.17.121) 11.345 ms 10.354 ms 10.395 ms 7 nyc-core-01.inet.qwest.net (205.171.17.82) 10.308 ms 17.639 ms * 8 wdc-core-02.inet.qwest.net (205.171.5.235) 19.174 ms 16.058 ms 17.888 ms 9 wdc-core-03.inet.qwest.net (205.171.24.6) 20.636 ms 20.425 ms 21.594 ms10 hou-core-01.inet.qwest.net (205.171.5.187) 36.128 ms 43.064 ms 44.321 ms11 hou-edge-07.inet.qwest.net (205.171.23.14) 37.849 ms 41.555 ms 41.659 ms12 205.171.36.154 (205.171.36.154) 52.102 ms 50.555 ms 52.055 ms13 192.12.10.60 (192.12.10.60) 49.084 ms 49.554 ms 46.130 ms14 ser9-msfc1.gw.utexas.edu (128.83.2.9) 50.420 ms 50.396 ms 46.334 ms15 128.83.37.18 (128.83.37.18) 49.908 ms 57.542 ms 50.448 ms16 cs.utexas.edu (128.83.139.9) 50.164 ms 46.581 ms *

Page 24: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

traceroute Christie.netlab.csc.villanova.edu

traceroute to Christie.netlab.csc.villanova.edu (153.104.203.200), 30 hops max, 38 byte packets

1 pm40.iwaynet.net (198.30.105.210) 117.453 ms 109.666 ms 119.863 ms

2 icg-gw.iwaynet.net (198.30.105.193) 119.719 ms 109.765 ms 139.856 ms

3 oeb7-sl0-0-0c10.columbus.oar.net (199.18.98.37) 129.763 ms 118.785 ms 109.832 ms

4 oeb9-atm1-0.columbus.oar.net (199.18.202.19) 119.748 ms 129.768 ms 109.871 ms

5 208.46.62.49 (208.46.62.49) 139.748 ms 139.751 ms 149.855 ms

6 chi-core-03.inet.qwest.net (205.171.20.33) 129.769 ms 129.782 ms 159.867 ms

7 chi-core-02.inet.qwest.net (205.171.20.29) 159.762 ms 139.801 ms 119.864 ms

8 nyc-core-02.inet.qwest.net (205.171.5.249) 149.749 ms 139.759 ms 149.839 ms

9 205.171.17.118 (205.171.17.118) 139.753 ms 169.741 ms 159.854 ms

10 205.171.38.62 (205.171.38.62) 149.753 ms 159.793 ms 205.171.38.86 (205.171.38.86) 159.861 ms

11 207.68.14.50 (207.68.14.50) 159.701 ms 629.814 ms *

12 153.104.0.249 (153.104.0.249) 179.816 ms 159.723 ms 199.836 ms

13 153.104.0.18 (153.104.0.18) 169.751 ms 159.807 ms 169.850 ms

14 * * 153.104.0.18 (153.104.0.18) 1339.845 ms !H

15 * * 153.104.0.18 (153.104.0.18) 1889.932 ms !H

16 * * 153.104.0.18 (153.104.0.18) 1869.955 ms !H

17 * * *

18 153.104.0.18 (153.104.0.18) 1759.827 ms !H * *

19 153.104.0.18 (153.104.0.18) 1849.827 ms !H

Routing to Christie - attempt when netlab was disconnected

Page 25: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Routing - scale

How big is a routing table?– Assume the current IP v4 address scheme– Assume that subnets are internal and not the

problem of internet routers– What is the potential load on a router?

Page 26: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Classless Inter-Domain Routing

First pass at hierarchical routing in the Internet– Assign addresses in clumps that are not

dependent on the old Class A, B, C scheme.– Much more flexible in the allocation of space

and able to serve the needs of users more efficiently.

Page 27: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

CIDR address assignments CIDR Block Prefix Equivalent Class C # of Host Addresses /27 1/8th of a Class C 32 hosts /26 1/4th of a Class C 64 hosts /25 1/2 of a Class C 128 hosts /24 1 Class C 256 hosts /23 2 Class C 512 hosts /22 4 Class C 1,024 hosts /21 8 Class C 2,048 hosts /20 16 Class C 4,096 hosts /19 32 Class C 8,192 hosts /18 64 Class C 16,384 hosts /17 128 Class C 32,768 hosts /16 256 Class C 65,536 hosts (= 1 Class B) /15 512 Class C 131,072 hosts /14 1,024 Class C 262,144 hosts /13 2,048 Class C 524,288 hosts

Page 28: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

A case …Currently, big blocks of addresses are assigned to the large Internet Service Providers (ISPs) who then re-allocate portions of their address blocks to their customers. For example, Pacific

Bell Internet has been assigned a CIDR address block with a prefix of /15 (equivalent to 512 Class C addresses or 131,072 host addresses) and typically assigns its customers CIDR

addresses with prefixes ranging from /27 to /19. These customers, who may be smaller ISPs themselves, in turn re-allocate portions of their address block to their users and/or customers.

However, in the global routing tables all these different networks and hosts can be represented by the single Pacific Bell Internet route entry. In this way, the growth in the number of

routing table entries at each level in the network hierarchy has been significantly reduced. Currently, the global routing tables have approximately 35,000 entries.

Ref: http://public.pacbell.net/dedicated/cidr.html

Page 29: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Network Address Translation

Primary source for information: RFC1631 Goal: Stand between the local network

environment and the rest of the Internet

RouterThe Internet

Local network environment

IP address

Page 30: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Why use NAT

Non unique addresses on the internal network work fine for communication that does not involve the global Internet.

To provide communication between a machine with a non unique address and the global Internet, the address must be translated into a globally unique address.

Page 31: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

How dynamic NAT works

Internal network has non-unique IP addresses NAT box has an

address translation table and a set of assigned IP addresses that can be used in the Internet

192.168.0.1

192.168.0.3

192.168.0.2

153.104.203.220

153.104.203.220

153.104.203.220

153.104.203.220

Page 32: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Internal host external connection

192.168.0.1

192.168.0.3

192.168.0.2

153.104.203.220

153.104.203.220

153.104.203.220

153.104.203.220

Internal host requests connection to an external host

192.168.0.3

NAT associates the internal address with a globally unique address

and makes the connection with the external host

Page 33: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Response from external host

192.168.0.1

192.168.0.3

192.168.0.2

153.104.203.220

153.104.203.220

153.104.203.220

153.104.203.220

192.168.0.3

Response from external host connected to the right internal host

Once there has been an exchange of messages, the table has the mapping needed and further communications are just passed through.

Page 34: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Overloading

192.168.0.1

192.168.0.3

192.168.0.2

153.104.203.220192.168.0.3Port 2000Port 2001Port 2002Port 2003Port 2004

Port 23

192.168.0.2/25

When there are not as many unique IP addresses as internal hosts who may want to access external hosts, add the use of port numbers in the table

Page 35: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Variable length subnet masks

Originally, subnet masks were of a fixed length– Clearly inefficient for an organization that has

logical subnets of varying size– Recent revisions of the routing protocol

implementations allow variable length subnet masks

Page 36: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Fragmentation, reassembly

Routers connect networks – pass messages from one network to another

Network characteristics are not all the same– maximum packet size varies

Routers must break up large packets to allow them to go into networks where the maximum allowed size is smaller

Question: Where to reassemble?

Page 37: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Reassembly question

Should a router join packets to make larger ones when a fragmented transmission is leaving a network?– Large packets require fewer routing decisions;

they are more efficient– Reassembly and then later fragmentation are

time consuming; these activities should be minimized.

Page 38: The Network Layer. Responsibilities 4 Addresses 4 Routing 4 Fragmentation and reassembly

Network layer summary

Addressing– current most common is IP v4– subnetting adds flexibility to network sizes

Routing– Link State and Distance Vector

Fragmentation/Reassembly– dealing with the restrictions of individual

networks.