OSI Network Layer

Post on 11-Jan-2016

24 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

OSI Network Layer. Laurent Babout, PhD, DSc. Based on Cisco CCNA. Objectives. Identify the role of the Network Layer, as it describes communication from one end device to another end device - PowerPoint PPT Presentation

Transcript

OSI Network Layer

Laurent Babout, PhD, DSc

Based on Cisco CCNA

2

Objectives• Identify the role of the Network Layer, as it describes

communication from one end device to another end device• Examine the most common Network Layer protocol, Internet

Protocol (IP), and its features for providing connectionless and best-effort service

• Understand IP addressing and subnetworking• Understand the principles used to guide the division or grouping

of devices into networks• Understand the hierarchical addressing of devices and how this

allows communication between networks• Understand the fundamentals of routes, next hop addresses and

packet forwarding to a destination network

3

Network Layer Protocols and Internet Protocol (IP)

• The main tasks of Layer 3:– Addressing– Encapsulation– Routing– Decapsulation

• Encapsulation of segment (layer 4 PDU)into packet

• Routers analyse packetto direct then to theirdestination

4

Network Layer Protocols and Internet Protocol (IP)

• Role of IPv4 (Internet Protocol v4) (RFC 791)– Connectionless – No connection is established

before sending data packets– Best effort (unreliable) – No overhead is used to

guarantee packet delivery (done by other layer)– Media independent - Operate independently of the

medium carrying the data

5

IPv4 #1• Connectionless

– Connection is the problem of layer 4 (Transport layer), for instance TCP (3-way handshake)

• Analogy to a letter sent without notification

6

IPv4 #2• Why is it “unreliable”?

– Small header, less delay in delivery. Reduce burden on the network during packet transport

– Unreliable means simply that IP does not have the capability to manage, and recover from, undelivered or corrupt packets• No acknowledgment• No data checking• No packet tracking / retransmission

7

IPv4 #3• Medium independent

– Responsibility of Layer 2 Data link layer to format frames for transmission on the desired media

– One thing that IP cares of: maximum size of PDU that medium can transport (MTU: Maximal Transmission Unit)

– Router can split packet if transmission from media to media with smaller MTU

8

IPv4 #4• Header of 20 bytes encapsulating segment

(transport layer)Data QoS priority: enables router to givepriority to voice and network route info overregular data

Control flag such as DF (Don’t Fragment)or MF (More Fragment)

Allow receiver to determine the place of a particular fragment in the original IP datagram. Useful if MF=1

No. of hops before packet is dropped: valuedecremented at each hop. Prevent packet being trapped in rooting loops

Info about protocol managementValue: TCP / UDP.

IP address of the source. Remains unchangedduring transmission. Allow destination to respondto the source if required IP address of the destination Remains unchanged

during transmission.Enables routers to forward packetto next hop towards the destination

9

IPv4 #5• Wireshark example

10

Grouping Devices into Networks and Hierarchical Addressing #1

• Why grouping devices into sub-networks?– More practical and manageable to group hosts into

specific network (called subnet)– Geography, purpose or ownership are factors that

influence subneting

11

Grouping Devices into Networks and Hierarchical Addressing #2

• Dividing a large network can increase network performance– Change a middle switch by a router allows to create 2 IP subnets,

hence 2 distinct broadcast domains. All devices are connected but local broadcasts are contained

12

Grouping Devices into Networks and Hierarchical Addressing #3

• Dividing a large network can also increase network security– Here student and researcher networks have different security levels– Access granted within network but denied outside using firewall

13

Grouping Devices into Networks and Hierarchical Addressing #4

• Why the intermediary device (aka. gateway) within a network is so useful in a network?– A host has the addresses of other host in its own network– If it does know the destination address, packets directed

outside via the gateway

14

Grouping Devices into Networks and Hierarchical Addressing #5

• Hierarchical addressing solves the problem of devices communicating across networks of networks– Uniquely identify each host– Has levels that assist in forwarding packets across internetworks

• Analogy to mail delivery: the level of info from the address is not analyzed in the same way by post-offices during transit

15

Grouping Devices into Networks and Hierarchical Addressing #6

• The same for IP addresses– Address contains prefix (portion) part which corresponds to

the network where the host is located– 32-bit mask indicates the prefix (number of consecutive 1s

makes prefix length)

• To divide network, network portion extended to borrow bits from host part: subnetworking

16

Subnetworking #1

• Classes A, B, C allow to have networks of different size on the net

17

Subnetworking #2• How to determine the network, the subnet and the

number of possible hosts knowing one host IP address and the mask (prefix)?

• Example: 172.16.132.70/20

11111111.11111111.11110000.00000000 in bits representation

OR

255.255.240.0 in decimal representation

172. 16.132.70 in bit representation is:10101100.00010000.10000100.01000110

Prefix length 20 means:

18

Subnetworking #3

• AND operation between IP address and mask to calculate network

• So, network address is: 172.16.128.0

10101100.00010000.10000100.01000110AND

11111111.11111111.11110000.00000000=

10101100.00010000.10000000.00000000

19

Subnetworking #4

• How to calculate number of subnets?– First need to know the address class

• 172. 16.132.70 is a class B (N.N.H.H), so network part considers 2 first octets (so 16 first bits)

– We know that the prefix length is 20, so 20-16=4 bits have been borrowed from the host part of the address

– The number of maximum subnet is 24=16– The number of hosts per subnet is 232-20 – 2 = 212 – 2 = 4094

• To be more general, if prefix length is m and borrowed number of bits is n for IPv4 address:– 2n maximum subnets– 232-m – 2 hosts per subnet (first: network address, last:

broadcast address)

20

Subnetworking #4

• So subnet IDs for network 172.16.128.0/20 are:– #0: 172.16.128.0 (hosts: 172.16.128.1 to 172.16.143.254)– #1: 172.16.144.0 (hosts: 172.16.144.1 to 172.16.159.254)– #2: 172.16.160.0 (hosts: 172.16.160.1 to 172.16.175.254)– #3: 172.16.176.0 (hosts: 172.16.176.1 to 172.16.191.254)– #4: 172.16.192.0 (hosts: 172.16.192.1 to 172.16.207.254)– #5: 172.16.208.0 (hosts: 172.16.208.1 to 172.16.223.254)– #6: 172.16.224.0 (hosts: 172.16.224.1 to 172.16.239.254)– #7: 172.16.240.0 (hosts: 172.16.240.1 to 172.16.255.254)

21

Fundamentals of Routes #1

• From IP address and mask, we can figure out easily what is the network the host belongs to

• Outside, no a priori knowledge of the other networks• Send to gateway!!!• Usually, gateway

is using either thefirst or the last hostaddress of subnet

22

Fundamentals of Routes #2

• Trace the steps of an IP packet as it traverses unchanged via routers from sub network to sub-network

23

Fundamentals of Routes #3

• Default gateway

24

Next Hop Addresses #1

• For a router to know where to send the packet, it needs to know what is its next hop

• Information provided into the routing table

25

• Local routing table output using show ip route• Besides next hop, also info about metric and

destination network • Router matches destination address with destination

network of a route• If more than 1

possible route,routing tableshows the onewith lowest metricvalue

Next Hop Addresses #2

2

26

Next Hop Addresses #3

• In set, a default route is used to forward packets with destination address not part of the routing table

• Default address route: 0.0.0.0• Packets sent to the Gateway of Last Resort

2

27

Next Hop Addresses #4

• Routing table can be built manually or dynamically• Static routing: router set manually. • Major problem: topology changed (e.g. router down).

Network11.1.1.0/24

Router C:192.168.1.1/24Configured manually asnext hop fornetworks 192.168.2.0/24and 11.1.1.0/24

and 11.1.1.0/24and 192.168.1.0/24

28

Network11.1.1.0/24

Next Hop Addresses #5• Static: IP routes for 3 routers

Router C Router A

Router B

CLASSLESS

29

Next Hop Address #6• Dynamic routing

– RIP, OSPF, EIGRP– When changes done one own router, passes info to

adjacent routers, and so on until idempotence

Network11.1.1.0/24

30

Network11.1.1.0/24

Next Hop Address #7• RIP: IP routes for 3 routers

Router A

Router B

Router C

CLASSFUL

top related