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

• Makes decisions about where traffic is sent
• Control plane packets are destined to or locally originated by the router itself
• The control plane functions include the system configuration, management, and exchange of routing table information
• The route controller exchanges the topology information with other routers and constructs a routing table based on a routing protocol, for example, RIP, OSPF or BGP
• Control plane packets are processed by the router to update the routing table information.
• It is the Signalling of the network
• Since the control functions are not performed on each arriving individual packet, they do not have a strict speed constraint and are less time-critical

### Data Plane

• Also known as Forwarding Plane
• Forwards traffic to the next hop along the path to the selected destination network according to control plane logic
• Data plane packets go through the router
• The routers/switches use what the control plane built to dispose of incoming and outgoing frames and packets

# 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

• U (route is up)
• H (target is a host)
• G (use gateway)
• R (reinstate route for dynamic routing)
• D (dynamically installed by daemon or redirect)
• M (modified from routing daemon or redirect)
• C (cache entry)
• ! (reject route)

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

# Or
netstat -nr


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.

### del


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

# That's a route to 0.0.0.0/1 (NOT a default route, a default route is 0.0.0.0/0) pointing to 10.144.15.100 which uses ppp0, plus a default route pointing to 192.168.1.1 which goes out eth0.

ip route del 0.0.0.0/1 via 10.144.15.100
ip route del default via 192.168.1.1


#### 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 -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