Docsity

Internetworking: Network Layer - Lecture Slides | EE 281, Study notes of Humanities

Toggle sidebar
bg1
1
Internetworking: Internetworking:
Network LayerNetwork Layer
Network
LayerNetwork
Layer
Applications
HTTP FTP SMTP
TCP UDP
IP
D ata link layer
protocols
Physical layer
protocols
Introduction & OutlineIntroduction & Outline
zIn the previous chapter, we discussed techniques to overcome some
of the limitations of LAN, i.e., usage of bridges to extend LAN
(p
ackets can travel over
g
eo
g
ra
p
hicall
y
lar
g
er area/s
)
with better use
(p g g p y g )
of bandwidth (learning bridges, spanning tree). But still we had:
– Heterogeneity: LANs of similar networks of similar addresses, Billion
hosts Æaddressing problem, addressing problem, logical addresses
zIn this chapter, we examine some approaches to overcome these
problems. This leads to the design of internetworking (internet):
arbitrary collection of networks (or LANS) interconnected by
routers and other devices. (not to be confused with Internet.)
z
We will discuss the main aspects and relevant protocols which make
EE 281, Internetworking 2
z
We
will
discuss
the
main
aspects
and
relevant
protocols
which
make
the building of the internet feasible and efficient.
zThis chapter consists of two main parts:
–IP Protocol, Subnetting, and IPv6
–Routing and Control Protocols
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29

Partial preview of the text

Download Internetworking: Network Layer - Lecture Slides | EE 281 and more Study notes Humanities in PDF only on Docsity!

Internetworking:Internetworking:

Network LayerNetwork LayerNetwork LayerNetwork Layer

A p p l i c a t i o n s H T T P F T P S M T P T C P U D P

I P

D a t a l i n k l a y e r p r o t o c o l s P h y s i c a l l a y e r p r o t o c o l s

Introduction & OutlineIntroduction & Outline

z In the previous chapter, we discussed techniques to overcome some of the limitations of LAN, i.e., usage of bridges to extend LAN (packets can travel over geographically larger area/s) with better use(p g g p y g ) of bandwidth (learning bridges, spanning tree). But still we had:

  • Heterogeneity: LANs of similar networks of similar addresses, Billion hosts Æ addressing problem,addressing problem, logical addresses

z In this chapter, we examine some approaches to overcome these problems. This leads to the design of internetworking (internet): arbitrary collection of networks (or LANS) interconnected by routers and other devices. (not to be confused with I nternet.)

z We will discuss the main aspects and relevant protocols which make

EE 281, Internetworking

2

z We will discuss the main aspects and relevant protocols which make the building of the internet feasible and efficient.

z This chapter consists of two main parts:

  • IP Protocol, Subnetting, and IPv
  • Routing and Control Protocols

PART 1PART 1PART 1PART 1

IPIP PROTOCOL &PROTOCOL &

SUBNETTINGSUBNETTING

EE 281, Internetworking

3

Router vs SwitchRouter vs Switch

z A key player in the implementation of the internet is the routery p y p z Router is a network-layer device. Its job is to move data between different network segments by looking into packet headers & determine the best path for the packet to travel.

EE 281, Internetworking

4

Router HardwareRouter Hardware

  • A router can also be viewed as a special processorp p (CPU+Memory+Bus+OS)CPU+Memory+Bus+OS) that forwards network traffic along optimized paths. It determines these optimized routes through the assistance of routing protocols. In this chapter, many of these protocols are discussed.

EE 281, Internetworking

7

Front Fiew

Rear View

Internet Architecture: TCP/IP SuiteInternet Architecture: TCP/IP Suite

z Defined by Internet Engineering Task Force (IETF)

z Hourglass Architecture with four layers

Telnet HTTP DNS TFTP

TCP UDP “Here all goes

EE 281, Internetworking

8

…

IP

NET 1 NET 2 NETn

through me”

TCP/IP vs OSI ModelTCP/IP vs OSI Model

EE 281, Internetworking

9

Internet Protocol (IP)Internet Protocol (IP)

zz IP is the primary network protocol of TCP/IP suiteIP is the primary network protocol of TCP/IP suite z All applications depend on IP, and IP runs over all networks z IP is unreliable connectionless protocol responsible for source-to- destination delivery: best-offer-delivery (post office analogy) z In the IP layer

  • addressing and subnetting are defined
  • network routing takes place i b d ( bl )

EE 281, Internetworking

10

  • Fragmentation based no on MTU ( no reassembly)
  • Type of service is specified

IP Datagram FormatIP Datagram Format

0 15 16 31 4 bit 4 bit header 8 bit type of service^ 16 bit total length (bytes)

20 bytes

32 bit source IP address

8 bit TTL

4 bit version

yp (TOS) 16 bit total length (bytes)

Options (if present)

32 bit destination IP address

8 bit protocol 16 bit header checksum

16 bit identification (^) flags3 bit 13 bit fragment offset

length

EE 281, Internetworking

13

Data

Options (if present)

IP HeaderIP Header

z Version: IPv4, for now(other IPv6, larger, no need for fragmentation) z header length : in 32-bits words, range 5 words (20B) to max 60B z total length : total length of IP datagram

  • max: 2 21616 -1 = 65,535 bytes, of which 20 to 60 bytes are for the header… 1 65 535 b f hi h 20 60 b f h h d z type-of-service : specifies to the router how datagram should be handled: minimize delay, maximize throughput, maximize reliability…based on the application needs z TTL : Time to live, the maximum number of routers the datagram can traverse. Default value is 64.
  • each router decrements the field by 1
  • when it reaches 0, the router discards it and sends an error message to the source.

EE 281, Internetworking

14

z identification, flags , fragment offset : control the fragmentation/ reassembly process (reassembly is done at the host)== more next=== z header checksum : only IP header, ones complement sum

IP Fragmentation/ReassemblyIP Fragmentation/Reassembly

z Fragmentation is the process of dividing a datagram message intog p g g g smaller separate packets based on the MTU (Maximum Transmission Unit). MTU is a network dependent parameter. Its value is set by the datalink layer and passed to IP-layer. Example: 48B; 1,500B; and 4,464B are the MTUs of ATM, Ethernet, and FDDI networks respectively. z In IP network, Fragmentation is done at the router and reassembly (the reverse process) is done @ the host.

  • [ is there any advantage for having this setting? ]

EE 281, Internetworking

15

[ y g f g g ] z In IP network, an identification number is assigned to all fragments of the same packet, indicated in the identification, flags , fragment offset fields

ExampleExample

Ident= x Offset= 0

Start of header 0 Rest of header 1400 data bytes

Question Host H1H1 sends a packet X with ident x and size 1400B to H8H through the network, shown below, the MTU in PPP segment networks are as indicated in the Figure. Illustrate the fragmentation process using a diagram. Assume header size is 20B.

Ident= x Offset= 512

Start of header 1 Rest of header

Ident= x Offset= 0

Start of header 1 Rest of header 512 data bytes

Answer: Note: DataSize= 532B-20B=512B Offset field: all fragments must be multiple of 8 Bytes-except last one (so how many fragments are allowed? Check out: 8192fragments/datagram) fragmentation only at router R2. Reassembly at H8.

H1 R1 R2 R3 H

EE 281, Internetworking

16

Rest of header 512 data bytes

Ident= x Offset= 1024

Start of header 0 Rest of header 376 data bytes

ETH IP (1400) FDDI IP (1400) PPP IP (512)

PPP IP (376)

PPP IP (512)

ETH IP (512)

ETH IP (376)

ETH IP (512)

MTU 532 MTU 532

Internet Address ClassesInternet Address Classes

7 bits 24 bits

Range of host addresses

There are five types, called classes, for IP addressing. All are 32-bits.

Class A 0 netid hostid

Class B

14 bits 16 bits

1 netid hostid

Class C

21 bits 8 bits

1 netid hostid

1.0.0.0 to 127.255.255.

128.0.0.0 to 191.255.255.

192.0.0.0 to 223 255 255 255

EE 281, Internetworking

19

Class D

28 bits

1 Multicast group id

Class E

27 bits

1 (reserved for future use)

223 .255.255.

224.0.0.0 to 239.255.255.

240.0.0.0 to 247.255.255.

Problems with Internet Address Classes:Problems with Internet Address Classes:

Three BigThree Big--Bear ProblemBear Problem

z Based on these classes, the IP address allows us to have networks from the f llfollowing combinations of valid network and host addresses: i bi ti f lid t k d h t dd

class Possible networks

Possible Hosts

Total (x) Percent of All IP addresses A 126 16,777,214 2,113,928,964 50%

B 16,382 65,534 1,073,709,056 25%

Too few networks

Depleted

EE 281, Internetworking

20

z To determine the number of possible hosts, use the formula 2 n^ – 2,where n is the number of bits in host field. The subtraction of 2 is for special address (the local network id and broadcast address.)

C 2,097,150 254 532,676,608 12.5% Too few hosts

Problems with Classful IP AddressesProblems with Classful IP Addresses

z The original classful address scheme had a number of problems

Problem 1.Problem 1. Too few network addresses for large networks Too few network addresses for large networks

  • Class A and Class B addresses are gone

Problem 2. Two-layer hierarchy is not appropriate for large networks with Class A and Class B addresses.

Problem 3: Inflexible. Assume a company requires 2,000 addresses

  • Class A and B addresses are overkill

EE 281, Internetworking

21

  • Class C address is insufficient (requires 8 Class C addresses) Problem 4: Exploding Routing Tables: Routing on the backbone Internet needs to have an entry for each network address. In 1993, the size of the routing tables started to outgrow the capacity of routers.

Solution toSolution to ClassfulClassful IP addresses:IP addresses:

The BIG PictureThe BIG Picture

To overcome the IPv4 addressing problems, several approaches were developed as summarized below

SolutionsSolutions

Subnetting (^) Supernetting

CIDR

IPv6 NAT and DHCP

EE 281, Internetworking

22

Next will discuss most of these approaches except the NAT (Network Address Translation) and DHCP (Dynamic Host Configuration Protocol)s are not part of our IP layer discussion ( but in later chapters)

Fixed-length Variable-length (VLSM)

Subnet MaskSubnet Mask

z Recall, given a host IP address, one can determine the corresponding network idt k id bby looking at the MSB bits of its IP address l ki t th MSB bit f it IP dd

  • for example, if the first 2 bits are "10" in the IP host address , then the first 16 bits of the address indicate its network-id and the last 16 bits indicate its host address. ( this can be viewed also as natural or default subnet) z In subnetting, one needs to look beyond its class to determine its subnet and host id. This is done using a Subnet Mask z A subnet mask is a 32-bit binary number whose bits are set to:
  • 1 if it corresponds to a bit in the IP address that should be considered as part of the extended network id

EE 281, Internetworking

25

as part of the extended network id.

  • 0 if the system should treat the bit as part of the host id.

z It is the job of subnet mask to extract (mask off) the network and host segments of the address

Example: Subnet MaskExample: Subnet Mask

8 bits

  • Two examples of subnets using class B:

Example 1: 8 bits are used to assign hosts

16 bits 8 bits

Class B Netid Subnetid Hostid

Subnet mask 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0

      1. 0

8 bits

Decimal notation

16 bits 8 bits

Example 2: 6 bits are used to assign hosts

EE 281, Internetworking

26

255.255.255. 192

Class B

16 bits 10 bits

Netid Subnetid Hostid

6 bits

Subnet mask 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0

Example 1: FixedExample 1: Fixed--length subnettinglength subnetting

z the next 2 figures illustrate the effect of fixed-length subnetting ( that is all subnets have the same number bits for the subnet_id and host_id fields) on a network of IP network address 141.14.0. z Observe:

  • Without subnetting the router needs to store all host IP addresses, which can in the range of 2 16 =65,536 entries
  • With subnetting, only 4 entries
  • We now have different type of routes, edge router, backbone router, …

EE 281, Internetworking Network without subnetting^27

EE 281, Internetworking

Network with subnetting 28

Example 3Example 3

Questions: Class B network on the Internet has a subnet mask of 255.255.240.0. What is the maximum number of hosts per subnet assume fixed subnetting? Answer: The lower 16 bits in B class are for subnet and host fieldsThe lower 16 bits in B class are for subnet and host fields. Since the most significant 4-bits are 1111: 240 = 2^7 + 2^6 + 2^5 + 2^4 so mask is binary: 1111 1111 1111 1111 1111 0000 0000 0000 So that leaves 12 bits for host or total of 2^12 host –2 = 4094 hosts

EE 281, Internetworking

31

Subnet Mask and IP addressSubnet Mask and IP address

z Given its IP address, a host can determine which class it belongs to and the boundary between host id and network idand the boundary between host_id and network_id (A, B, or C …using leading bits ) Æ That is with IP address one can determine the host network z Given the subnet mask , host can determine boundary between subnet_id and host_id Æ that is, with its own the IP address and subnet mask, a host can determine: (1) similar hosts in its own subnet (2) a host on a different subnet but on its own network

EE 281, Internetworking

32

(3) a host on a different network.

Example 4Example 4

z Assume a host EE281 student was given the IP address 140.252.1.1_ g and the subnet mask 255.255.255.

  1. What is the class of EE281_student IP address?
  2. How many bits are assigned for its subnet_id?
  3. Determine whether the following IP addresses, are on the same subnet, or network as of the host EE281_student. (a) 140.252.4.5 (b) 140.252.1.23 (c) 192.43.1.

EE 281, Internetworking

33

Answer

EE 281, Internetworking

34

VariableVariable--LengthLength Subnet MaskingSubnet Masking

(VLSM): Example…(VLSM): Example…

z In VLS configuration, we can allow one subnet field of 2 bits:

  • So we divide the network into 4 subnets (2 2 ) each of 62 hosts (2^6 -2)
  • 3 out of these 4 subnets would assigned to our three 60-host departments
  • the 4 th^ is divided into 2 smaller networks (30 host each), and this achieved by using 3 bits in the subnet field ( so 4 bits for host, or 24-2 = hosts) (see figure in the next slide) z How about the mask address. In VLS routers usually needs to 2 or more masks, one applied after the other:
  • in this example it need 1st^ one mask to divide the network into four: zz Mask1Mask1 : consists of 26 ones (: consists of 26 ones ( 24 ones 24 ones of the class C default maskof the class C default mask, and and 2 ones 2 ones for the subnet mask): 11111111. 11111111. 11111111. 11 000000. (255.255.255.192) z Mask2 : consists of 27 ones ( 24 ones of the class C default mask, and 3 ones for the subnet mask): 11111111. 11111111. 11111111. 111 00000. (255.255.255.224)

EE 281, Internetworking

37

EE 281, Internetworking

38

Pop QuizPop Quiz

(a) You have the following IP addresses: 171.68.3.3 and 171.68.2.3. If the subnet mask is 255.255.255.0, these addresses belong to the same subnetaddresses belong to the same subnet. a. True b. False

(b) Now you have the following IP addresses: 171.68.3.3 and 171.68.2.3. If the subnet mask is 255.255.0.0, these dd b l h b

EE 281, Internetworking

39

addresses belong to the same subnet. a. True b. False

Example 2: VariableExample 2: Variable--Length SubnetsLength Subnets
with nonwith non--contiguous maskcontiguous mask

Questions: The network designer in Example 1 is given class C network with 200.1.1 address and wants to form the two subnets for the departments: SA with 72 hosts and SB with 35 hosts Devise a possible arrangement of subnet mask to make this possibleDevise a possible arrangement of subnet mask to make this possible Answer: in class C the most lower 8 bits are for subnet and host fields. A possible arrangement: SA: set first bit to 0 (to identify the subnet SA), the remaining 7 bits are for hosts (2^7 -2) hosts (large enough to accommodate 72 hosts!) so the mask: 255.255.255.0/(7 bits for host address) ( notation: 0/) SB: 10/(6 bits for the host address) (notation 10/)

Note: z 01/ or 00/ are not possible masks for SB (why?)

EE 281, Internetworking

40

z 01/, or 00/ are not possible masks for SB (why?) “The essential requirement is that any distinct subnet numbers remain distinct when the longer one is truncated to the length of the shorter” z How about if SB is as big as SA: Use two or more smaller subnets for SB