Saturday, January 26, 2013

Subnetting

By Neil Lynch

Subnet Masking
Subnet masks tell the computer or router which part of an IP address is the network portion and which part is the host portion.
Subnet masking is a manipulation of sorts in the host’s octets of the IP classes, Class A, Class B, and Class C. It is sometimes done to control the flow of traffic in terms of hosts per segment, etc. According to Cannon, et al., Manipulating the mask via subnetting is a big improvement over fixed-length mask because it allows a single major network number to be subdivided into smaller subnetworks (102). ”Whenever you subnet
a network address you lose some of the host addresses that you could have had without subnetting” (Cannon 96). By masking a third octet in a Class B, IP address, you reduce the number of addresses significantly.

Network administrators can use up to 14 bits to subnet a Class B address and six bits of Class C host octet.

The best way to learn to subnet a network is to use a Class C address; it allows you to subnet the last octet. For example, let’s look at subnetting with the current lab project as illustrated, (Cannon, et al., 464)  

In this network there were segments with various hosts and interfaces. 
The Network IP was 192.3.2.0; the  interfaces were F0/0, F0/1, and S0/0 with 51, 4, and 2 hosts        
respectively.
 
Since the network was Class C, I took the IP address 192.3.2.0 and masked its host by 2bits (2^y =4), where y = 2. This gave me four (4) subnets with 6 host portions remaining.
 
My right-most bit was 2^6 or 64 in decimal which is what I used as my incremental value for the four subnets: 192.3.2.0/26, 192.3.2.64/26, 192.3.2.128/26, 192.3.2.192/26.

Each address now had 62 hosts which accommodated Net 1 and Net 2. 

Net 3, on the other hand, the third       subnet…must accommodate (2)hosts. With the host portion of 6 remaining, and only 2 bits are required for this host, I move the mask 4 bits to the right, making it /30. With y=4, we get 2^4=16 more subnets, each with 2 host IP addresses:192.3.2.64/30, 192.3.2.68/30 through 192.3.2.124/30
 
 
 
 
 
                                                                             References
Cannon, Kelly. Kelly Caudle, Anthony Chiarella. CCNA Guide to Cisco Networking 4/e. Boston: 2009, Print.


 
 
 








Sunday, January 20, 2013

Data Initiation, Encapsulation and Navigation through TCP/IP protocol stack

by Neil Lynch

This article describes a two segment network interfaced with a router. It shows how data is initiated and encapsulated as it navigates through the 4-layers of the TCP/IP protocol stack from Application to Network, utilizing the ARP cache to find the gateway’s address, so the MAC frames can be delivered, filtered, and pulled-off allowing the packet to be sent to the destination (Host) MAC and IP addresses. Once a connection is established a Host to Host, connection-oriented (3-way handshake) would begin, using the TCP protocol at the Transport Layers for reliability.

The TCP/IP host composes its data at the Application Layer. Ex. [Data]

The data is then passed to the Transport Layer protocol of which there are two (TCP and UDP), the connection-oriented protocol is chosen in this exercise, for it reliability as opposed to the unreliable (UDP) connection-less protocol.

The data is encapsulated in the Transport layer’s header. This segment manages data size and flow control.

Ex. [Transport Layer header [Data]]

The Data and Transport Layer header are passed to the Network Layer, the next step down in the TCP/IP protocol stack where the packet now includes the IP header, the Transport layer header and Data.

Ex. [Source IP address [Destination IP address [Transport layer header [Data]]]]

At the next step in the protocol stack, the OSI Data Link layer, containing the source MAC address and the destination (gateway or router’s) MAC address are added to the frame; … the sending computer attained the router’s MAC address by looking in the ARP cache or by sending an ARP request.

Ex. [source MAC address [destination (router *E1) MAC address [Source IP address [Destination IP address [Transport layer header [Data]]]]

The encapsulated frame is sent to the remote segment via the default gateway (the router or network interface connecting the local segment … to the other networks). When the router receives the frame, it pulls off the network interface information (OSI Data Link layer header) which contains the router’s MAC address because it’s no longer necessary, now that the router is in possession of the packet. It then analyzes the packet at the Network layer.

Ex. [Source IP address [Destination IP address [Transport layer header [Data]]]]

                         MAC address is removed from frame, leaving (packet)

The router then checks its routing table against the destination IP address to locate the appropriate network interface through which to forward the packet.

If the router is directly connected to the network for which the packet is destined, it will re-address the frame at the Network Interface layer with the MAC address of the destination host; it gets this MAC address from its ARP cache or an ARP request on the destination’s subnet.

Ex. [source (router *E0) MAC address [destination MAC address [Source IP address [Destination IP address [Transport layer header [Data]]]]

             Frame re-addressed by Router after receiving MAC address from ARP(cache or request)

Once the router has the correct MAC to IP mapping, it repackages the Network Interface (OSI Data Link layer 2) using the MAC addresses of the destination host.  After repackaging, the frame is sent to the destination host via the lower level of the (TCP/IP) protocol stack. The MAC addresses of the frame are then decapsulated at the Data Link layer and the packet then moves up to the Network Layer, where the IP addresses are decapsulated. At the next layer up … the Transport layer, the segment is decapsulated, the Data is then received by Application Layer and ultimately by Host B.

 Now that a route (connection) is established, the three-way handshake can begin, ultimately allowing data to be transferred between hosts.

TCP requires a three-way handshake, once communication is established between Host A and Host B; that’s a connection request from Host A to Host B,  and then an acknowledgement from Host B to Host -A.

·       Ex. Host A -----------------connection request-------------> Host B

·             Host A <--------- ------acknowledgement----------------Host B

·                               Once achieved, data is transmitted.

·              Host A ---------------------data---------------------------->Host B









*E1, E0 router connecting two segments --------> (E1/E0) ----------->,

Host A to E1 and  E0 to Host B