All notes


Tx and Rx

Tx: Transmission rate. Rx: Receiving rate. Throughput would be the total of TX and RX.


Software Defined Networking. It is a way to controlling the network from a logically centralized high level program i.e. Controller. Decouples control plane from data plane. Network Virtualization is one of the application of SDN - Software defined networking can be leveraged as a tool to achieve Network Virtualization, which carves out multiple virtual networks from a single physical network.

Control Plane

Data Plane

Usual commands



Genmask: The netmask for the destination net; '' for a host destination and '' for the default route.

Iface: Interface to which packets for this route will be sent.


route -n
# Kernel IP routing table
# Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
#     *        U     0      0        0 eth0

# Or
netstat -nr

The above command shows that if the destination is within the network range –, then the gateway is *, which is

When packets are sent within this IP range, then the MAC address of the destination is found through ARP Protocol and the packet will be sent to the MAC address.

In order to send packets to destination which is not within this ip range, the packets will be forwarded to a default gateway, which decides further routing for that packet. We will see this shortly. ping

The following is the sequences of evets that happens when the above ping command is executed.

  1. First it will query the DNS server to obtain the ip-address of ( for example: )
  2. The destination address ( ) is not within the network range.
  3. So, in Layer-3 (IP header) the DESTINATION IP will be set as "".
  4. In Layer-2, the DESTINATION MAC address will be the filled in as the MAC address of the default gateway ('s MAC ). The MAC will be found by using ARP as described earlier.
  5. When the packet is sent out, the network switch ( which works on Layer-2 ), send the packet to the default gateway since the destination MAC is that of the gateway.
  6. Once the gateway receives the packet, based on its routing table, it will forward the packets further.


# Kernel IP routing table
# Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
#       UG    1      0        0 ppp0
#         UG    0      0        0 eth0

# That's a route to (NOT a default route, a default route is pointing to which uses ppp0, plus a default route pointing to which goes out eth0.

ip route del via
ip route del default via

An example: A Sample Network Architecture

Ref. Assume, we have 2 individual networks ( and, with subnet mask of ). We also have a "GATEWAY" machine with 3 network cards. 1st card is connected to, 2nd card is connected to, and the 3rd card is connected to the external world (ip

# Make 192.168.3.* Accessible from 192.168.1.*
route add default gw
route add -net netmask gw

# Make 192.168.1.* Accessible from 192.168.3.*
route add default gw
route add -net netmask gw

# Allow Internet Access ( External World ).
route add default gw
route add -net

adds the normal loopback entry, using netmask (class A net, determined from the destination address) and associated with the "lo" device (assuming this device was prviously set up correctly with ifconfig(8)). route add -net netmask dev eth0

adds a route to the network 192.56.76.x via "eth0". The Class C netmask modifier is not really necessary here because 192.* is a Class C IP address. The word "dev" can be omitted here.