无题
CS3611 Lab 4
Problem 1
Solution
For VM1 the code should be:
1 | # Create bridge and add port |
Similarly, for VM2 the code should be:
1 | # Create bridge and add port |
Problem 2
Solution
The screenshot of Wireshark on s1 and enp0s8 is as follow:
From the screenshot, I select an ICMP packet to analyze. We can see that from from the first 4 line, we can recognize many familiar protocols. The protocols in physical layer and link layer are not that important because we are running on a virtual environment. In the Network layer, we see IPv4 and ICMP being used in this packet, In the transport layer, we see UDP being utilized. Also in this layer we finally see VXLAN protocol, which is an encapsulation protocol that allows the creation of virtual Layer 2 networks over a Layer 3 infrastructure.
VXLAN works in the following ways:
- Encapsulation: When a node in the VXLAN network wants to send a packet to another node, it encapsulates the original Ethernet frame inside a VXLAN packet. This VXLAN packet is then encapsulated inside a UDP datagram, and this UDP datagram is further encapsulated inside an IP packet.
- Transport: The encapsulated packet is then sent across the IP network. The IP network only sees the outer IP and UDP headers and routes the packet based on these headers.
- Decapsulation: When the packet reaches the destination node, it decapsulates the packet to extract the original Ethernet frame. The Ethernet frame is then processed as normal.
The VLAN-like encapsulation technique also encapsulate Layer 2 Ethernet frames within Layer 4 UDP datagrams, thus enabling Layer 2 segments to be created over Layer 3 networks and use layer 3 to guide its way towards the target host. That is why VXLAN can reaches destinations across different LANs, surpassing the duty of purely Layer 2.
In addition, the VXLAN header, which includes a 24-bit VXLAN Network Identifier (VNI), segregates different VXLAN overlay networks from each other, so the same IP subnet can be used across different VNIs without conflict.
That is my brief answer to how VXLAN works.
Problem 3
Solution
In the default condition, the bandwidth between s1 and s2 are awful.
The screenshot above shows that the receiver side bandwidth is close to zero, which is abnormal because we had set up a VXLAN between them.
The reasons may be because the VXLan protocol will encapsule the original udp datagram which may increase the packet size. Therefore we have to decrease the messages encapsuled inside VXLAN so that after encapsulation the packet can be sent via the Link.
Problem 4
We can use
iperf3 -c 10.0.0.1 -M <MTU_Length>
to restrict the length of MTU in iperf3 command.When using default MTU size, we get the following result:
Setting MTU to be bigger won’t help increase the badnwidth, the reason is also because of the encapsulation of VXLAN and the capacity of our link.
When we set MTU size to 100, we get the following result:
We get a much better result. The
-M
command VXLAN control the MSS of TCP segmentation. Therefore setting the MSS to be smaller helps reduce the retransmition rate and thus increase the resulted bandwidth.It is worth noticing that setting MTU size to be too small reasonably reduce the bandwith, because in this case too many bandwidth are used to transfer controlling messages like headers of datagrams.
We use
sudo ifconfig enp0s8 mtu <num>
to dictate the mtu size of our network adaptor enp0s8.We set the mtu to 9000, and test the bandwidth using iperf3 under default configuration. The result is as follow:
The bandwidth is much bettwe. As is discussed before, by increasing the MTU allowed to sent via the link, we can encapsule l larger message in the VXLAN packet without worring the retransmission, and thus exploting better use of the link.