All notes
Rou

FAQ

Tx and Rx

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

SDN

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

route

Ref.

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

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

Output

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
The above command shows that if the destination is within the network range 192.168.1.0 – 192.168.1.255, then the gateway is *, which is 0.0.0.0.

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 www.google.com 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 google.com ( for example: 74.125.236.34 )
  2. The destination address ( 74.125.236.34 ) is not within the network range.
  3. So, in Layer-3 (IP header) the DESTINATION IP will be set as "74.125.236.34".
  4. In Layer-2, the DESTINATION MAC address will be the filled in as the MAC address of the default gateway ( 192.168.1.10'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.

An example: A Sample Network Architecture

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

# Make 192.168.3.* Accessible from 192.168.1.*
route add default gw 192.168.1.10
route add -net 192.168.3.0 netmask 255.255.255.0 gw 192.168.3.10

# Make 192.168.1.* Accessible from 192.168.3.*
route add default gw 192.168.3.10
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.10

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

route add -net 127.0.0.0 adds the normal loopback entry, using netmask 255.0.0.0 (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 192.56.76.0 netmask 255.255.255.0 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.