Networking: Network Layer Summer 2013 Cornell University 1 Today - - PowerPoint PPT Presentation

networking network layer
SMART_READER_LITE
LIVE PREVIEW

Networking: Network Layer Summer 2013 Cornell University 1 Today - - PowerPoint PPT Presentation

CS 4410 Operating Systems Networking: Network Layer Summer 2013 Cornell University 1 Today How packages are exchanged in a WAN? Network Layer IP Naming Subnetwork Forwarding Routing Algorithms 2 Protocol Stack


slide-1
SLIDE 1

1

CS 4410 Operating Systems

Networking: Network Layer

Summer 2013 Cornell University

slide-2
SLIDE 2

2

Today

  • How packages are exchanged in a WAN?
  • Network Layer
  • IP
  • Naming
  • Subnetwork
  • Forwarding
  • Routing Algorithms
slide-3
SLIDE 3

3

Protocol Stack

Application Link Physical Application Link Physical Computer A Computer B Transport Transport Network Network M M Ht M Ht Hn M Ht Hn Hl Message Segment Datagram Frame

slide-4
SLIDE 4

4

WAN

  • Usually, thousands of computers need to be

interconnected.

  • The capabilities that LANs offer cannot support

larger networks.

  • We need more services than the Link Layer
  • ffers.
  • Why?
  • Clever Naming
  • Efficient forwarding/routing of messages.
slide-5
SLIDE 5

5

Network Layer

  • Mission: Transfer messages from the source-computer to the destination-

computer.

  • Attention: this is different from the mission of the Link Layer.
  • Services:
  • Forwarding / Routing
  • Guaranteed delivery, bandwidth, etc
  • Security
  • Not all the protocols support these services.
  • The Network Layer protocol depends on the kind of network we want to built:
  • Virtual-circuit networks
  • Datagram networks
  • Necessary network device:
  • Router: It knows where to forward the message.
slide-6
SLIDE 6

6

Network Layer

  • Virtual-circuit networks
  • 3 phases
  • Establish a virtual circuit.

The Network Layer finds the path from the source to the destination.

Reserve resources for the virtual circuit.

  • Transfer data

Packets pass through the virtual circuit.

  • Destroy virtual circuit.

Release resources.

  • Disadvantages?
  • Datagram networks
  • Every packet has the destination

address and it is routed independently in the network.

  • The router uses the destination

address to forward the packet towards the destination-computer.

slide-7
SLIDE 7

7

IP

  • Network Layer Protocol for the Internet:
  • Internet Protocol
  • For Datagram networks.
  • IPv4, IPv6
  • Datagram structure:

Version Header Length Type of service Length Identification Flags Fragment Offset Time to live Protocol Header Checksum Source IP Address (32-bit) Destination IP Address Options Data

slide-8
SLIDE 8

8

Naming

  • All the computers in the Internet have one or more IP addresses.
  • For IPv4:
  • 32 bits
  • Dotted-decimal notation (Ex: 147.76.89.4)
  • Contain information about the subnetwork in which a host belongs.

Example: For the address 140.251.27.18 we know that:

  • It belongs to a host in Cornell, as Cornell gives addresses of the form

140.251.xxx.xxx. → subnetwork address 140.251.0.0/16, mask 255.255.0.0

  • It belongs in host in Linguistics Department, as the addresses of this

department is 140.251.27.xxx. → subnetwork address 140.251.27.0/24, mask 255.255.255.0

  • The number 18 distinguish this host from other hosts in the same

subnetwork of Linguistics.

  • Assigned by a DHCP server in the subnetwork.
  • Dynamic Host Configuration Protocol
  • Every computer that is inserted in the subnetwork, communicated with the DHCP

server to obtain an IP address.

slide-9
SLIDE 9

9

Subnetwork

223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.3.27 223.1.3.1 223.1.3.2 223.1.2.1 223.1.2.2

What happens when 223.1.1.1 wants to send a packet to 223.1.3.2 ?

slide-10
SLIDE 10

10

Forwarding

  • Each router has a routing table.
  • The routing table is an array of triples (at least).
  • Each tuple has:
  • Subnetwork id, subnetwork mask, gateway
  • So, the routing table of the previous example is:

223.1.1.0, 255.255.255.0, 0 223.1.3.0, 255.255.255.0, 1 223.1.2.0, 255.255.255.0, 2

  • When a datagram is received, all the subnetwork masks are applied to its IP address (binary AND
  • peration) to find the subnetwork in which the destination belongs.
  • So, a datagram with destination to 223.1.3.2 is forwarded to gateway 1.
  • Even though we know the destination IP, we do not know the MAC address of 223.1.3.2, in order the

packet to go from the gateway 1 to the destination.

  • With the ARP protocol the router asks which node of one subnetwork has the needed IP.
  • The destination replies with its MAC address.
  • Finally, the packet can be sent to the destination.
slide-11
SLIDE 11

11

Routing Algorithms

  • How does the router construct its

routing table?

  • The routing path should be the shortest

path from the source to the destination.

  • General problem:
  • Graph (V, E)
  • V is the set of routers.
  • E is the set of links between the

routers.

  • Each edge has a cost related to

the distance.

  • If the source is attached to the

router V1 and the destination to the router V2, what is the shortest path between V1 and V2? 2 1 2 3 1 1 2 5 3 V1 V2 5

slide-12
SLIDE 12

12

Routing Algorithms

  • Find shortest bath between all the possible pairs of nodes.
  • Global routing algorithm
  • The algorithm needs global knowledge (all links between routers and their costs)
  • f the network as input.
  • Dijkstra algorithm

Returns the shortest path between one node and all the other nodes.

  • Decentralized routing algorithm
  • No router has global knowledge about the cost of all links.
  • Routers, iteratively, exchange information with their neighbors for shortest paths

between nodes.

  • Distance vector algorithm

Returns the shortest path from all nodes to all nodes.

slide-13
SLIDE 13

13

Network Layer

Computer A Application Link Physical Application Link Physical Computer B Transport Transport Network Network Link Physical Switch Link Physical Switch Link Physical Router Network

slide-14
SLIDE 14

14

Network Layer

Switch Router

slide-15
SLIDE 15

15

Today

  • How packages are exchanged in a WAN?
  • Network Layer
  • IP
  • Naming
  • Subnetwork
  • Forwarding
  • Routing Algorithms