21
Packet Switching Packet Switching Jun Jie, NG 08Oct2011 08 Oct 2011

CCN1 - Packet Switching Jun Jie

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CCN1 - Packet Switching Jun Jie

Packet SwitchingPacket Switching

Jun Jie, NG08‐Oct‐201108 Oct 2011

Page 2: CCN1 - Packet Switching Jun Jie

Reference BookReference Book

Chapter 3: Packet Switching

Page 3: CCN1 - Packet Switching Jun Jie

What is a Switch?‐ In the simplest terms, a switch is a mechanism that allows us to interconnect links to form a larger network.

‐ A switch is a multi‐input, multi‐output device, which transfers packets from an input to one or more outputs. Note: 

We refer to these inputs and outputs as “ports”.

‐ A switch is connected to a set of links and, for each of these links, runs the appropriate data link protocol to communicate with the node at the other end of the link. 

‐ A switch primary job is to receive incoming packets on one of its links and to transmit them on some other link. This function is sometimes referred o as either switching or forwarding. 

Page 4: CCN1 - Packet Switching Jun Jie

Question

How does the switch decide on which output port to place each packet? 

‐In this topic, we will look at the following approaches:(a) Datagram (Connectionless approach)(b) Virtual Circuit (Connection‐oriented approach)(c) Source Routing 

Page 5: CCN1 - Packet Switching Jun Jie

Contention vs Congestion‐ Contention occurs when multiple packets have to be queued at a switch because they are competing for the same output link.

‐ Congestion means that the switch has so many packets queued that it runs out of buffer space and has to start dropping packets.

Page 6: CCN1 - Packet Switching Jun Jie

(a) Datagram Approach‐ The idea is simple.

‐ Every packet contains enough information to enable any switch to decide how to get y p g y gto its destination.

‐ To decide how to forward a packet, a switch consults a forwarding table (or a routing t bl ) At it h 2 l k t th d ti ti d i t it t t M t htable). At switch 2, look at the destination, and inspect its output <‐> Match 

the colored circles on the diagram and forwarding table.  Is that clear so far?

Page 7: CCN1 - Packet Switching Jun Jie

Connectionless Characteristics

Page 8: CCN1 - Packet Switching Jun Jie

Exercise…

Node (    ) Destination Next Hop

Node (    ) Destination Next Hop

Node (    ) Destination Next Hop

Node (    ) Destination Next Hop

Node (    ) Destination Next HopNode (    ) Destination Next Hop

Page 9: CCN1 - Packet Switching Jun Jie

Exercise… (An observation)

What have I observed?h h f d blThe steps to construct the forwarding table are as follow:~ At each node, do not consider  but other nodes on the network. Next:

O 3 Q8~ Trace the path it has to go through and note the immediate next‐hop to form the forwarding table.

TRY TUTORIAL 3, Q8

Page 10: CCN1 - Packet Switching Jun Jie

(b) Virtual Circuit Switching‐Widely used.

‐ Uses the concept of a virtual circuit.p

‐ Connection‐oriented model: requires a virtual connection from the source host to the destination to be set up first before any data is sent.

‐ i.e. First stage: Connection Setup. Second stage: data transfer.

‐We consider each at a time.

Page 11: CCN1 - Packet Switching Jun Jie

(b) Virtual Circuit Switching‐ Connection setup phase: Necessary to establish “connection state” in each of the switches between the source and destination hosts.

‐ This connection state for a single connection consists of an entry in a Virtual Circuit table in each switch through which the connection passes. 

O t i th VC t bl i l it h t i‐ One entry in the VC table on a single switch contains:

Page 12: CCN1 - Packet Switching Jun Jie

(b) Virtual Circuit Switching‐ See how it corresponds (colour circles):

Page 13: CCN1 - Packet Switching Jun Jie

Tired? No…? Try one Exercise…y

Page 14: CCN1 - Packet Switching Jun Jie

(b) Exercise: Virtual Circuit Switching

A ( ) (b) ( ) b lAnswer (a), (b), (c) below.

Page 15: CCN1 - Packet Switching Jun Jie

Host A connects to B.

(b) Exercise: Virtual Circuit Switching

Page 16: CCN1 - Packet Switching Jun Jie

Host C connects to G.

(b) Exercise: Virtual Circuit Switching

Page 17: CCN1 - Packet Switching Jun Jie

Host E connects to I.

(b) Exercise: Virtual Circuit Switching

Question:R l k f ( )Relook from (a) to (c).Are you clear with the VCI assignments? 

Page 18: CCN1 - Packet Switching Jun Jie

(b) Exercise: Virtual Circuit Switching(a)(b)(c)

At this point, 2 paths imply that the second path’s VCI is 1 while the first is 0.

( )

At this point, only one h h h

What have I observed?

path crosses through imply VCI assigned to a value of 0.

What have I observed?~ A connection is defined from one point to another. I have redrawn the path taken from (a) to (c) again here in different colors. See l licolor lines. 

Assignment of VCI is as general:~In my own words, at a POINT,      or      that the color lines,                  or                   orpass thro gh the COUNT ill increase b 1

Next:O 3 Qpass through, the COUNT will increase by 1, 

starting from 0.TRY TUTORIAL 3, Q7

Page 19: CCN1 - Packet Switching Jun Jie

(c) Source Routing‐ Name derives from the fact that all the information about the network topology is required to switch a packet across the network is provided by the source host..

‐Many ways to implement. 

Rather than just to rotate the header, each switch could just strip the first element as it uses it.it.

Other option include header pointer! 

Page 20: CCN1 - Packet Switching Jun Jie

(c) Source Routing

Explanation: QUESTION!!In this example the address received by B isIn this example, the address received by B is not reversible and doesn't help B know how to reach A. Propose a modification to the delivery mechanism that does allow for reversibility. Your mechanism should NOT require giving all switches globally unique q g g g y qnames. 

Page 21: CCN1 - Packet Switching Jun Jie

(c) Exercise: Source Routing

ANSWER (reference from the textbook)We provide space in the packet header for a second address list, in which we build the return address. Each time the packetthe return address. Each time the packet traverses a switch, the switch must add the inbound port number to this return‐address list, in addition to forwarding the packet out the outbound port listed in the “forward” address. 

For example, as the packet traverses Switch 1, towards forward address “port 1”, the switch writes “port 2” into the return address. Similarly, Switch 2 must write “port 3” in the next position of thewrite  port 3  in the next position of the return address. 

The return address is complete once the packet arrives at its destination.