Problem 14
Question
Here are the switch rules for the multiple-flow-table example in \(2.8 .2\) Learning Switches in OpenFlow: $$\begin{array}{cccc}\text { Table } & \text { match field } & \text { match action } & \text { no-match default } \\ \hline \mathrm{T}_{0} & \text { destaddr } & \text { forward and send to } \mathrm{T}_{1} & \text { flood and send to }\mathrm{T}_{1} \\\\\mathrm{~T}_{1} & \text { srcaddr } & \text { do nothing } & \text { send to controller } \end{array}$$ Give a similar table where the matches are reversed; that is, \(\mathrm{T}_{0}\) matches the srcaddr field and \(\mathrm{T}_{1}\) matches the destaddr field.
Step-by-Step Solution
Verified Answer
The revised table with swapped match fields is as follows:\[\begin{{array}}{{cccc}}\text{{Table}} & \text{{match field}} & \text{{match action}} & \text{{no-match default}} \ \hline \mathrm{T}_{0} & \text{{srcaddr}} & \text{{forward and send to }} \mathrm{T}_{1} & \text{{flood and send to }} \mathrm{T}_{1} \\mathrm{T}_{1} & \text{{destaddr}} & \text{{do nothing}} & \text{{send to controller}} \end{{array}}\]
1Step 1: Identify the original match fields and actions
Identify the original match fields and their corresponding actions. In Table \(\mathrm{T}_{0}\), the match field is destaddr and its action is to forward and send to \(\mathrm{T}_{1}\). In case of no match, the default is to flood and send to \(\mathrm{T}_{1}\). In Table \(\mathrm{T}_{1}\), the match field is srcaddr and the action is to do nothing. In case of no match, the default action is to send to the controller.
2Step 2: Swap the match fields
Swap the match fields of Table \(\mathrm{T}_{0}\) and Table \(\mathrm{T}_{1}\). This means that Table \(\mathrm{T}_{0}\) will now match the srcaddr and Table \(\mathrm{T}_{1}\) will match the destaddr.
3Step 3: Write the new table
Write the new table with the swapped match fields, while keeping the match actions and no-match defaults the same. The new table should look as follows: \[\begin{{array}}{{cccc}}\text{{Table}} & \text{{match field}} & \text{{match action}} & \text{{no-match default}} \ \hline \mathrm{T}_{0} & \text{{srcaddr}} & \text{{forward and send to }} \mathrm{T}_{1} & \text{{flood and send to }} \mathrm{T}_{1} \\mathrm{T}_{1} & \text{{destaddr}} & \text{{do nothing}} & \text{{send to controller}} \end{{array}}\]
Key Concepts
Learning SwitchesFlow TablesNetwork Packet Routing
Learning Switches
Learning switches play a crucial role in network operations by easing the flow of data packets through a network. At their core, learning switches use *OpenFlow*, a modern protocol that enables the operation of network devices from various manufacturers to be managed centrally from a controller.
Unlike traditional switches, learning switches can adapt to the network traffic dynamically. They learn the network pathways by observing the source and destination addresses of incoming packets, and they make intelligent decisions based on this information. The learned pathways are stored in what we call *flow tables*. This way, a network doesn’t need to be manually configured for each connection, which saves time and reduces errors.
Essentially, a learning switch will learn where a device is located in the network by observing its data packets and then creates a map of address-to-interface, therefore increasing the efficiency of data transmission.
Unlike traditional switches, learning switches can adapt to the network traffic dynamically. They learn the network pathways by observing the source and destination addresses of incoming packets, and they make intelligent decisions based on this information. The learned pathways are stored in what we call *flow tables*. This way, a network doesn’t need to be manually configured for each connection, which saves time and reduces errors.
Essentially, a learning switch will learn where a device is located in the network by observing its data packets and then creates a map of address-to-interface, therefore increasing the efficiency of data transmission.
Flow Tables
Flow tables are the heart of an OpenFlow switch. They act like a traffic director, detailing how packets should be handled and forwarded. Each entry in a flow table consists of:
- A match criterion: This could be a source address, destination address, or even specific packet characteristics.
- A set of actions: Instructions on what to do with a packet if it matches the criteria. Actions could include forwarding the packet, modifying it, or dropping it.
- A no-match default: What to do if the packet doesn’t match any criteria, often involving sending the packet to the network controller.
Network Packet Routing
Network packet routing in OpenFlow networks is performed by intelligently directing packets from their source to their appropriate destination. Using flow tables, switches determine the route that these packets should take across the network.
In traditional routing, when a packet arrives at a switch, it checks the destination address and forwards the packet to its next hop based solely on this address. However, the process in OpenFlow is much more refined. It takes into account both source and destination addresses, along with other criteria, to make routing decisions. This is because flow tables in OpenFlow allow for a detailed mapping of packet-handling rules that take both addresses into account.
If a packet doesn’t match any existing rules in the flow table, the switch can query a central controller. This controller can either instruct the switch on how to route the packet or can install a new rule to directly handle similar packets in the future, optimizing the network further and reducing latency.
In traditional routing, when a packet arrives at a switch, it checks the destination address and forwards the packet to its next hop based solely on this address. However, the process in OpenFlow is much more refined. It takes into account both source and destination addresses, along with other criteria, to make routing decisions. This is because flow tables in OpenFlow allow for a detailed mapping of packet-handling rules that take both addresses into account.
If a packet doesn’t match any existing rules in the flow table, the switch can query a central controller. This controller can either instruct the switch on how to route the packet or can install a new rule to directly handle similar packets in the future, optimizing the network further and reducing latency.
Other exercises in this chapter
Problem 10
(This exercise assumes some familiarity with Distance-Vector routing as in 9 Routing-Update Algorithms.) a. Suppose switches are able to identify the non-switch
View solution Problem 13
Consider the following arrangement of three switches S1-S3, three hosts h1-h3 and one OpenFlow controller C. As with exercise 12.0, assume that the switches rep
View solution Problem 9
Suppose you want to develop a new protocol so that Ethernet switches participating in a VLAN all keep track of the VLAN "color" associated with every destinatio
View solution