Switch && Bridges
The core job of a switch is to take packets that arrive on an input and forward them to the right output so that they will reach their appropriate destination. There are a variety of ways that the switch can determine the “right” output for a packet, which can be broadly categorized as connectionless and connection oriented approaches.
A switch is a multi-input, multi-output device that transfers packets from an input to one or more outputs. Thus, a switch adds the star topology to the P2P network.
switched networks are considered more scalable (i.e., more capable of growing to large numbers of nodes) than shared-media networks because of this ability to support many hosts at full speed.
A switch’s 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 to as either switching or forwarding.Main function of the network layer.
How does a packet decides where to go?
Using the header of the packet to determine. The first is the datagram or connectionless approach. The second is the virtual circuit or connection-oriented approach.
How to identify the end addrress of a packet?
48-bit addresses used for Ethernet, which is unique for all nodes. Use the number of port to identify input and output of switch.(二层交换机,就要使用二层Ethernet协议寻找地址)
Datagrams && Virtual circuit
Datagrams:switch uses a forwarding table.A host can send a packet anywhere at any time, since any packet that turns up at a switch can be immediately forwarded. 2 same packets may follow different paths.
VC:conection oriented appraoch, requires setting up a virtual connection from the source host to the destination host before any data is sent. This is a two-stage process. The first stage is “connection setup.” The second is data transfer.
switch which connection bypasses will record all information in VC table.,includes VCI,incoming interface&outgoing interface.
A virtual circuit identifier (VCI) that uniquely identifies the
connection at this switch and which will be carried inside the
header of the packets that belong to this connection. Packets sent out according to corresponding interface.;链接建立后每次发送的消息报头都会携带VCI信息字段。每次经过一个节点更新VCI。最后发送返回确认信息回到源节点。
链接断开后,switch会移除相应的entry。
每个switch记录信息,switch使用没使用过的VCI记录entry,packet outgoing. VCI:link scope。
建立连接的方式:1.Administrator configure.
VC:需要保证不同的QoS。
ATM
ATM是virtual circuit最典型的应用,尽管现在deploy的已经很少了。ATM cell==ATM packet.
small fixed-length packets which only contaisn 54bytes. too short,large head overhead;too long,padding data to waste bandwidth.
Bridges & LAN switches
They are the same defnition. Use multi-input/output,1 input will flow ot all output. Thus can increase bandwidth of network.Be extended to #number of ports Mbps throughtput.
bridge takes self-learning and timeout mechanism to continually remove entries and add entries to the table.record which host is connected to which port.
Spanning tree algorithms
Avoid loop. subsets of original topological with no loops.
IP
Use IP to solve heterogenioty in network by defining simple,common internetwork model. Then use ARP to resolve global IP address to a local linklayer IP address.
IP routing algorithm:determine efficient route to any destination.
Link state:RIP
distance vector:OSPF
Switch&Bridges usually need to be scalable to deal with special situations.
Mininet
According to the [Mininet website]:http://mininet.org/, Mininet creates a realistic virtual network, running real kernel, switch and application code, on a single machine (VM or native), in seconds, with a single command. We will use Mininet in programming assignments throughout the semester.$
preceeds Linux commands that should be typed at the shell promptmininet>
preceeds Mininet commands that should be typed at Mininet’s CLI,#
preceeds Linux commands that are typed at a root shell prompt
The default topology is the minimal topology, which includes one OpenFlow kernel switch connected to two hosts, plus the OpenFlow reference controller. This topology could also be specified on the command line with –topo=minimal. Other topologies are also available out of the box; see the –topo section in the output of mn -h.
If the first string typed into the Mininet CLI is a host, switch or controller name, the command is executed on that node. Run a command on a host process:h1 ifconfig -a
.
Note that only the network is virtualized; each host process sees the same set of processes and directories. For example, print the process list from a host process:
h1 ping -c #packets h2, ping from 1 host to another host.
Mininet hosts can run any command or application that is available to the underlying Linux system (or VM) and its file system. You can also enter any bash command, including job control (&, jobs, kill, etc..)
You don’t need to drop into the CLI; Mininet can also be used to run self-contained regression tests.
Run a regression test:sudo mn --test pingpair
sudo mn --test iperf
This command created the same Mininet, ran an iperf server on one host, ran an iperf client on the second host, and parsed the bandwidth achieved.
Spanning-tree algorithm
Each bridge has a unique idetifier, first selects the bridge with the smallest id as the root of spanning tree.The root bridges always forward all its port.Next, each bridges compute its shortest path to the root and notes which of port is on the path. If equally close to the root, selects bridges with the smallest ID.
Each bridge records the current best configuration message it has seen on each of its ports.
Unicast & Broadcast, Multicast
multicast:each port decides whether accept the message or not. Learns this by observing the source address of the packets that it receives over this port.
extended LANs don’t scale well because some LANS don’t want to be bothered by other broadcast messages.
One solution to scale is to use VLAN. a single extended LAN be partitioned into several LAN. assingned color/idetifier to each LAN segments and limit the number of segments in an extended LAN that will receive any given broadcast message.