Whenever need to send an IP packet to some particular network and to select the appropriate path for that it needs a process called routing. Routing process done by a device called a Router. For a given computer network routing can divide into two types. They are direct and indirect routing.
Direct routing is sending massages within a LAN. Indirect routing is sending messages within a WAN. Indirect routing is more complicated than the other, because messages pass through many routers. Hence there we need to use different routing strategies. There are four types of routing strategies Fixed routing, Flooding, Random routing and Adaptive routing. Information about routing strategies is given below in the table.
Routing strategies
Advantages
Disadvantages
Fixed routing - routing information are centrally maintain by the directory called central database.
Updating new information is easy, because all changes done to central Database
Cause network traffic
Dynamic changes are not possible
Central database has to work with many routers.
Flooding - when router received a IP packet, router send that packet to every route.
Simple mechanism
Router doesn't need to analyze IP packets
Most of the time IP packets are reach the destination
Cause high network traffic
Duplicate packets might reach the destination
Random routing - router select a random path to the received packet and send it in that path.
It doesn't make network traffic unnecessarily
It is a simple mechanism
No guarantee that the IP packet will not meet the destination
Adaptive routing - router maintain a routing table with capable of update according to the network changes.
Less network traffic
The best path will select most of the time
Routers need to keep routing tables
Process each packet
Need to update routing tables automatically with the changes in the network
More concern about the Adaptive routing, there are two methods of adaptive routing they are Next hop routing and default routing.
Next hop routing father divide into two types which are Host specific routing and Network specific routing. Other than that there is a Default routing. All three routing methods are tabulated below.
Routing methods
Advantages
Disadvantages
Host specific routing - in this routing, router keep a one record for one host in the routing table (similarly every host).
There may be large number of records
Multiple routes can increase the number of records
Difficult to update table with the changes of IP
Network specific routing - router keep one record for one network in the routing table (similarly every network).
Number of records are reduced
Easy to update
Default routing - this is a default IP route, which is another record in the routing table. This route will be select if any of the records doesn't match with the IP packet destination.
Adaptive routing based on routing tables. To analyze (update) routing tables basically there are three methods they are Connected, Static and Dynamic. Information about these methods is tabulated below.
Routing table updating methods
Advantages
Disadvantages
Connected - every interface of a router which connected to a network is given an IP address. Using this IP address router automatically select the network address to which it connected.
Static - user can manually assign records to the routing table. These are called static records.
Easier to configure and understand
Minimum CPU processing
More time taken for configure and maintaining
Manual configurations can make more errors
Dynamic changes are difficult to handle
User has to have a proper knowledge about the network
Dynamic - using some routing protocols routing tables are updated automatically.
Network changes are easier
More accurate
Protocols are automatically react to the network changes
Comfortable with network changes
More router resources are used
User need more knowledge about the network to configuration and troubleshooting
In order to perform dynamic routing table update methods, administrators need to use protocols. Protocols help to routers in this stage to learn about the network to allow dynamic changes. There are some amount of dynamic routing protocols are there but here we explain about RIP and IGRP.
RIP (Routing Information Protocol)
RIP is a Distance Vector Protocol and it has two versions called RIPv1 and RIPv2. RIP uses 15 maximum hop counts (16th hop is defined as infinity). It uses to send completed routing table updates to all active interfaces each after every 30s. Basically RIP is good with small scale networks.
RIP uses few timers such as Periodic, Hold down and Expiration timers. Periodic timer uses to count the 30s timing cycle to keep sending routing tables to network. Expiration timer does some sort of error detection by keep watching the routing table information from neighbors. If those information are not sent for 180s particular router can remove the updates which received from that problem occurred router.
Let's concern about problems in RIP, here few of them are given here. Slow convergence happen due to the delay of getting routing tables in fact complexity of the network. Triggered updates are the solution for the slow convergence and Route Poisoning is assigning number of hops as infinity. Due to some communication process between routers, Instability is happen and the solution for that is send only selected table information to neighbors (this is called Split Horizon). Hold Down timer uses to announce to the network if any part of a network went down.
IGRP (Interior Gateway Routing Protocol)
IGRP is a CISCO proprietary Distance- Vector Routing Protocol and it can use maximum of 255 hop counts. This protocol uses the delay and bandwidth of the line by default as a metric for select the best routing path. This is called a composite metric and also MTU (Maximum transmission Unit), Reliability and Load can be used, but not default.
SWITCHING
Switch is intelligent device and most of the time it works in layer 2, but also uses in layer 3. Switch has separate collisions domain and one broadcast domain. In most occasions switches are behave as transparent bridges. As example, finding the MAC address of a web server is illustrated. Below shown illustration are shows that process [1].
There are three switching functions, Address learning, Forward/filter decision and Loop avoidance.
Address learning - layer 2 switches store the source MAC address of each received frames on every interface and these information are write down to MAC address table (this is a MAC address data base). In default the MAC address table is empty and it can hold MAC address and interfaces of every received frame. Using these MAC address table information switches can learn MAC address of that given network. First switch attempt to examine MAC address and the interface of received each frame and it these information stored to the table if are new to the switch and also setting the inactivity timer to 0. Otherwise inactivity timer set for new entry.
Forward/filter decision - If a switch received a frame with a destination MAC address switch looks at the MAC address table and learn the destination MAC address and exit interface. Then it sends to that particular destination through filtering process. If destination address is not unicast or otherwise broadcast, multicast or unknown, switch forward the frame to all its ports. If a unicast frame received and unicast address found in the table switch can does two things, one thing is it forwards the frame if source and destination MAC addresses are different. Else if same it just ignored the frame and not going to forward.
Loop avoidance - multiple connections between switches are make redundant can cause network loops. These looping problems are solved by using Spanning Tree Protocol.
And also MAC address table entries or address can divide in to three categories which are Dynamic MAC addresses, Permanent MAC addresses and Restricted-static entries. MAC addresses added to the table while switching happens is called Dynamic Mac address and Permanent MAC addresses are MAC addresses associated with a ports. Particularly assigned MAC address with a port is given with additional restrictions is called Restricted-static entries.
When concern about the internal processing of a switch or else switching there are three methods, which are Store-and-forward, cut-through and Fragment-free. For switching methods switches are use Frame Check Sequence (FCS) checking before forward or filter a frame. This FCS is included in the Ethernet trailer.
Store-and-forward - in this method, switch wait for all bits in the given frame and store it. Then switch check the FCS before it forward the frame. This method is more accurate.
Cut-through - switch forward the frame without checking FCS as soon as it can and this method is faster but less accurate.
Fragment-free - switch wait until first 64 bytes of the frame received to forward it and it checks the errors due to collision.
3. TCP
TCP/IP is a reliable protocol rather than UDP is unreliable. TCP stand for Transmission Control Protocol and IP stand for Internet Protocol. TCP is a one of the layer 4 protocol and it allows to error, flow and congestion control.
Data transmission using TCP is has three phases; they are Establish connection, Transfer data and Terminate the connection. In these three phases, it allows to send data and acknowledgement separately or both together (this known as Three way hand shake or Piggy backing). Each phase is given below in the table without three-way hand shake [2].
Establish the connection
Data Transfer
Terminate the connection
SYN, SYN/ACK and ACK are
1- Byte messages. This allows full duplex data transfer.
Each segment ACK is received and data transferred as segments. Each number has Sequence number to identification.
Basically connection termination done by client. ACK and FIN messages are 1- Byte.
All TCP manipulation is done using TCP header and it's shown below [3].
Source and destination port address are ranging 0 - 65535. When establish the connection first sequence number should be decided and it is called Initial Sequence Number (ISN). And sequence number can be any number between 0 and (2^23) - 1. Acknowledgement (ACK) number is the next sequence number expected by the receiver. HLEN has maximum size of header of 60 Bytes including 20 Bytes standard header. Reserved is reserve for future use.
Control field has 6 bit stream. Window size maintains the amount of data segments which should carry. Checksum field helps to error control process and urgent pointer use whenever URG flag is set in the control field.
TCP has four timers. Retransmission Timer use for error control, Persistence Timer avoiding the window size going to empty, Keep alive Timer count how long the client idle and how long client alive and finally Time-waited timer avoid problems with delayed FIN segments.
In UDP - User Datagram Protocol it doesn't have connection establishment or termination process and also it not doing any error controlling, flow and congestion controlling. UDP has only 8 bytes header. UDP known as unreliable protocol because, there is no guarantee of delivering all data which has received by any party. But UDP uses for broadcast type applications because of it s simplicity. The UDP header is given below [4].
4. IP
IP is layer 3 protocol and it's defined as unreliable protocol but combination of TCP/IP is known as reliable and UDP/IP is unreliable. IP doesn't have error, flow or congestion control.
5. VLAN
VLAN stand for virtual Local Area Network. VLAN use to reduce hardware cost and limiting size of the broadcast domain, provide better security, group users virtually and separate specialized traffic from mainstream traffic.
VLAN has logically segmented network and switch ports can be assigned to that VLAN. Then all ports in a one VLAN share a one broadcast domain. In the same switch but doesn't belong to above VLAN cant share this broadcast domain. Such VLANs have separate broadcast domains and separate MAC address tables.
Trucking is another important fact which named by CISCO whose adding additional header to a LAN frame to identification of VLANs to frames. This tagging or trucking can send frames for multiple VLANs. There are two types of tagging; ISL (Inter-Switch Link) and IEEE 802.1Q. ISL header and Ethernet frame is given below [5].
Passing traffic through VLANs can't be done if is it's not configured to do so. This configuration is called Inter-VLAN routing, and in this case one router physical interface divided into few sub interfaces or multiple logical interfaces. Each actual physical interface can make up to 65535 logical interfaces. These FastEthernet ports are defined as 0/0.n (n = 1, 2, 3, …).
VTP (VLAN Trucking Protocol)
VTP is massaging system to advertise VLAN configuration information to trunk ports. These configurations carried out by a common administrative domain. VTP has three modes; Server, Client and Transparent which are given below.
Server
Client
Transparent
Creates VLANs
Modifies VLANs
Deletes VLANs
Sends/forward advertisements
Synchronizes
Saved in NVRAM
Forward Advertisement
Synchronizes
Not saved in NAVRAM
Create VLANs
Modifies VLANs
Deletes VLANs
Forwards Advertisements
Doesn't synchronize
Saved in NVRAM
VTP advertise multicast frames and VTP servers and clients are synchronized to newest revision number from upcoming frames. These advertisements are spread to the network for each 5 min or if there is a change in the network. To reduce pointless traffic in the network can be increases the bandwidth.
6. STP
In some networks uses redundancy routs to different purposes. These redundant paths may cause the endless looping problems of networks. Hence all switches configure with Spanning Tree Protocol (STP) to avoid looping issues still giving opportunity to have redundancy.
As shown in the figure [6] looping problems can solve by temporally disabling the useless redundant paths. If any instance user need to have this extra route, then user able to active it again.
These switches can block any interfaces as above explained, but BPDU (Bridge Protocol Data Units) still forward. If it's going to forward, then each interfaces can send and receive frames and BPDUs in any instance.
The advantage of the STP is, it can make LANs usable by avoiding endless loops. But on the other hand some of the redundant paths can't use because of they are blocked when necessary and also traffic might go along long paths while having blocked shorter paths. These are the few disadvantages of STP.
BPDUs are special frames which consisted with source bridge ID, accumulated path cost, some of other information. Initial root bridge cost is always 0. Root bridge cost is inversely proportional to bandwidth.
10mbps - 100 / 100mbps - 10 / 1Gbps - 2
STP works in four steps and each step are given below with detail.
Elect a root bridge - bridge's MAC address or bridge ID has given to every bridge and a identification number. Root Bridge gets the least MAC address. Election start with sending BPDU frames from every switch and these BPDUs analyzed for a minor root bridge ID.
Elect a root port for each non root bridge - root port for a non root bridge is selected by considering the minimum accumulated root cost. Then each path getting a cost but Root Bridge doesn't have a root port.
Elect a designated bridge for LAN segments - if there are several bridges across two LAN segments, designated bridge is the bridge which has least cost to the LAN segment to root and the designated port in the selected bridge is the port which has least coast to the root as same.
Elect a designated port for each designated bridge - Then the other ports are blocked and if there are equal root bridge costs, select the least MAC address from them.
7. ACL
Access control List (ACL) is set of conditions to check network traffic which tries to go through a router interface. It can accept or deny packets according to the conditions and it tells to the router to do so. These conditions are based on source or destination address, protocols and upper-layer port numbers. ACL has two types; Standard and Extended ACLs.
In standard ACLs ACL number is in between 1 - 99 and it checks the source address.