Friday, February 26, 2016

SDN Controller - OpenDayLight

 SDN Controller - OpenDayLight - Build your own test lab

Is it time to throw away traditional switching-routing technologies and embrace SDN ?? I don’t think so yet, but we are certainly moving towards that.
There are a lot of resources out there in the internet regarding Software Defined networking (SDN). Big number of network vendors are releasing SDN products including many industry leaders. There are quite a few opensource SDN Controllers as well: OpenDayLight, OpenContrail, Floodlight, Ryu.
As a network world geek, I can't resist trying out one of these SDN controllers. Below are the simplest steps of installing OpenDaylight(ODL) and Mininet to get started. I used Ubuntu 12 in a virtual machine for this test.


Step 1: Install ODL
Get the download link of ODL you desire
Extract the compressed file.
tar -zxvf distribution-karaf-0.3.3-Lithium-SR3.tar.gz
Install java, maven which are prerequisite for ODL.
sudo apt-get install openjdk-7-jre openjdk-7-jdk maven
Step 2: Start ODL
Export JAVA_HOME path and start Karaf
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386/
cd distribution-karaf-0.3.3-Lithium-SR3/
./bin/karaf
Add L2 switch and Web-gui features from karaf console.
feature:install odl-restconf odl-l2switch-switch odl-openflowplugin-all odl-mdsal-apidocs odl-dlux-all
Step 3: Install and run Mininet
Mininet is a simulation tool to create virtual network supporting openflow.
sudo apt-get install mininet
You might want to run “apt-get update” beforehand to get updated list of packages from the repository.
Run mininet with tree topology
sudo mn --controller=remote,ip=127.0.0.1 --topo=tree,3
Step 5: Open ODL Web Interface
Enter http://localhost:8080/index.html in your browser with default user and password (admin/admin) to login.

Sunday, January 31, 2016

MTU, fragmentation and reassembly

Recently, I got the opportunity to work in a freshly built LTE/4G core and backhaul network. We observe a strange problem of the network where video traffic (RTSP/UDP) from UE devices in an APN were not reaching the video management servers. Although http or ftp traffic was passing through.
After hours of search, finally the problem was discovered in a one of the EPC component where it had a smaller MTU. Http traffic might have passed due to PMTUD.
Realizing the importance of MTU, let’s review this old school topic of networking.
MTU
The Maximum Transmission Unit (MTU) is the largest number of bytes in a single datagram can have on a particular data communications link.
Usually, in most Ethernet access networks it is 1500 bytes for IP packet.
At Layer 2, standard fame size is 1518 bytes, which includes additional header of 14 bytes and FCS of 4 bytes.
Other communication media types have different MTU size. Example: SONET/SDH has MTU of 4470 bytes.
https://habrastorage.org/getpro/habr/post_images/6c1/6da/135/6c16da13526de3dfd0368d31a5f1b6d9.jpg
Different type of encapsulation adds overhead.
  • GRE (IP Protocol 47) adds 24 bytes (20 byte IPv4 header, 4 byte GRE header)
  • MPLS adds 4 bytes for each label in the stack
  • IEEE 802.1Q tag adds 4 bytes (Q-in-Q would add 8 bytes)
  • VXLAN adds 50 bytes
  • OTV adds 42 bytes
  • IPsec encryption can add 52-76 bytes of overhead depending on transport or tunnel mode and the encryption/authentication algorithm
http://www.cisco.com/c/dam/en/us/td/i/000001-100000/80001-85000/81001-82000/81608.ps/_jcr_content/renditions/81608.jpg

Fragmentation
IP fragmentation involves breaking a datagram into a number of pieces that can be reassembled later.
Routers can fragment IPv4 packets unless the Do-Not-Fragment (DF) bit is set to 1 in the IPv4 header.
Identification, total length, fragment offset, “more fragments" and "don't fragment" flags in the IP header, are used for IP fragmentation and reassembly.
Fragmentation and reassembly of packets increase CPU and memory overhead.
pmtud_ipfrag_02.gif

MSS
Maximum segment size (MSS) is 40 bytes smaller than the MTU.
MSS = MTU – (IP Header + TCP header)
To assist in avoiding fragmentation between endpoints of TCP connection, MSS value is exchanged and lowest is set.
PMTUD
Path MTU Discovery (PMTUD) is used to avoid fragmentation in the path between the endpoints.
It is used to dynamically determine the lowest MTU of routers along the path from a packet's source to its destination.
PMTUD is only supported by TCP.

References