Showing posts with label Networking. Show all posts
Showing posts with label Networking. Show all posts

Thursday, 12 November 2015

IP Subnetting

IPV4  Subnetting:
An IP Address is represented as four decimal integers.
- 192.168.1.1
An IP Address is 32 bits long.
- 192.168.1.1 is expressed as:
11000000.10101000.00000001.00000001 

Subnet mask can be represented in several formats:

- Mask  =  255.255.255.0
- Mask =  /24
- Mask =  11111111.11111111.11111111.00000000

Sample Question: What is the subnet address, first usable address and broad cast address for IPAddress of 192.168.5.12/26 ?
Answer: 
Step 1:  First calculate decimal subnet mask for the above IP address i.e /26 means masking 26 bits out of 32 bits i.e

11111111.11111111.11111111.11000000 
which means:
255.255.255.192 

Subtract 192 from 256 :  256 - 192 = 64.

Step 2: Calculate the subnets:
Subtract 192 from 256:  256 - 192 = 64.
Subnets are in the ranges of 64.
So, total subnets for the above address range are:
192.168.5.0 , 192.168.5.64, 192.168.5.128, 192.168.5.192 

Step 3: Calculate subnet, first available host and broad cast address.

Here, we found four subnets:

192.168.5.0 , 192.168.5.64, 192.168.5.128, 192.168.5.192 

Our given host was 192.168.5.12.
First available host means  first host after subnet address before the given host:
which means:
First available host is : 192.168.5.1 

Broadcast address is the last host before the next subnet  with in the range of the given host.
So, Broadcast address is: 192.168.5.63 

Why subnet mask is used?
A. Subnet mask is used to determine to which subnet external packet from outside has to be forwarded. Given the destined IP address simple AND operation of IP address with subnet mask will give the network id or sub net id to which packet has to be forwarded. 

A subnet mask is a 32 bit number in 1's represent NetworkID & SubnetID, and 0's represent HostIDs.

For example, if a network is divided into four subnets by taking two bits from last 8 bits of host address, the very first ip address is subnet id of the first subnet as well as network id of the entire network. Similarly, last ip address of the last subnet is the direct broadcast address of that subnet as well as for the entire network.

A network divided into four subnets is shown below with routing table. Router determines to which interface packet has to go from the routing table which consists of NetworkID, SubnetMask and Interface.



IP Address classification:



Unicasting and Broadcasting:

If a host sends a message to another host, it is called unicasting.

If a host sends a message to all other hosts in the same network, it is called Limited Broadcasting.

If a host sends a message to all the hosts in another network, it is called Directed Broadcasting.



Given the IPAddresses in the image below, their corresponding Network ids,Direct broadcast address and Limited broadcast addresses are entered.



Variable Length Subnetting means subnet mask can be different from one subnet to other subnet which is show below. In this case instead of dividing into four parts we are dividing into three parts in which one subnet contains 128 IPAddresses and the other two with 64 IP Addresses each. 



Given a subnet mask and Type of Network ( class A or B or C or D) we can derive how many subnets are available for that network. Also, from the subnet mask we can determine how many IPAddresses are available as shown.Number of hosts will be total No. of IPAddresses - 2.






Reference: All About Computer Networks






Friday, 6 June 2014

How TCP connection is established and terminated.

  1. The requesting end (normally called the client) sends a SYN segment specifying the port number of the server that the client wants to connect to, and the client's initial sequence number (ISN, 1415531521 in this example). This is segment 1.
  2. The server responds with its own SYN segment containing the server's initial sequence number (segment 2). The server also acknowledges the client's SYN by ACKing the client's ISN plus one. A SYN consumes one sequence number.
  3. The client must acknowledge this SYN from the server by ACKing the server's ISN plus one (segment 3).
These three segments complete the connection establishment. This is often called the three-way handshake.


Figure 18.3 Time line of connection establishment and connection termination.
The side that sends the first SYN is said to perform an active open. The other side, which receives this SYN and sends the next SYN, performs a passive open

Reference: http://www.pcvr.nl/tcpip/tcp_conn.htm 

Tuesday, 2 October 2012

IP Subnetting


Issue: IP routing to Salesforce Starting point IP ( salesforce server)
Solution:

Step 1. Go to Windows cmd prompt.
Step 2. >
Step 3. use tracert command to find the  origin  IP of salesforce.com
Step 4. >tracert salesforce.com

Output:
Tracing route to salesforce.com [204.14.234.33]
over a maximum of 30 hops:

  1    33 ms     1 ms     1 ms  192.168.1.1
  2    27 ms    25 ms    25 ms  ABTS-KK-Static-001.228.178.122.airtelbroadband.in [122.178.228.1]
  3    26 ms    25 ms    25 ms  ABTS-KK-Static-221.32.166.122.airtelbroadband.in [122.166.32.221]
  4    26 ms    25 ms    25 ms  AES-Static-025.102.22.125.airtel.in [125.22.102.25]
  5   409 ms   306 ms   306 ms  AES-Static-122.36.144.59.airtel.in [59.144.36.122]
  6   428 ms   306 ms   306 ms  xe-5-1-0.edge1.LosAngeles6.Level3.net [4.26.0.89]
  7   259 ms   390 ms   306 ms  vlan90.csw4.LosAngeles1.Level3.net [4.69.144.254]
  8   533 ms   306 ms   306 ms  ae-93-93.ebr3.LosAngeles1.Level3.net [4.69.137.45]
  9   528 ms   306 ms   306 ms  ae-3-3.ebr1.SanJose1.Level3.net [4.69.132.9]
 10   533 ms   307 ms   246 ms  ae-61-61.csw1.SanJose1.Level3.net [4.69.153.2]
 11   472 ms   306 ms   306 ms  ae-14-60.car4.SanJose1.Level3.net [4.69.152.6]
 12   533 ms   306 ms   306 ms  SALESFORCE.car4.SanJose1.Level3.net [4.71.114.38]
 13   533 ms   307 ms   306 ms  204.14.234.187
 14   353 ms   307 ms   306 ms  salesforce.com [204.14.234.33]

Trace complete.

Step 5.How to understand  an  IP address convention:
sample IP Address:  204.14.234.187
WWW naming convention : F.Q.D.N  ->  Fully.Qualified.Domain.Name
Mapping FQDN to routers and IP address -> Networks.HostNames -> Networks.x.Subnets.IPAddresses 
Mapping to Schneider Office Network domain 1 ->  10.217 . 20.65 ->  Networks . x .  20  .  ( 1- 254 )
Mapping to Schneider Office Network domain 2 ->  10.217 . 20.65 ->  Networks . x .  21  .  ( 1 - 254 )
Mapping Sales Force Networks ->  Networks . x .  21  .  ( 1 - 254 ) ->  (Continents) . x . 20/21 . ( 1 - 254)
 Sales Force.com total number of Networs -> AP, EU , NA, EMEA.
 Mapping to EU0 . x . salesforce . com 
 That is your browser www address.
 Mapping to www address -> EU0 . salesforce . com 
 Let's try this IP address in google.com  , the source of information.
 Step 6. Let's try finding this .net IPAddress.
 ae-2.r20.sngpsi02.sg.bb.gin.ntt.net [129.250.4.142]

Step 7.This is  (Logical or Physical) IP Naming Convention.


Monday, 24 September 2012

Difference between a Router and a Switch

Routers, switches and hubs are all common components of wired Ethernet networks.

A network router is a more sophisticated network device compared to either a network switch or a network hub. Like hubs and switches, routers are typically small, box-like pieces of equipment that multiple computers can connect to. Each features a number of ports on the front or back of the unit that provide the connection points for these computers, a connection for electric power, and a number of LED lights to display device status. While routers, hubs and switches all share similar physical appearance, routers differ substantially in their inner workings.

Traditional routers are designed to join together multiple local area networks (LANs) with a wide area network (WAN). Routers serve as intermediate destinations for network traffic. They receive incoming network packets, look inside each packet to identify the source and target network addresses, then forward these packets where needed to ensure the data reaches its final destination.

Routers for home networks (often called broadband routers) are designed specifically to join the home (LAN) to the Internet (WAN) for the purpose of Internet connection sharing. In contrast, switches (and hubs) are not capable of joining multiple networks or sharing an Internet connection. A network with only switches (hubs) must instead designate one computer as the gateway to the Internet, and that device must possess two network adapters for sharing, one for the home LAN and one for the Internet WAN. With a router, all home computers connect to the router as peers, and the router performs all gateway functions.

Additionally, broadband routers contain several features beyond those of traditional routers such as integrated DHCP server and network firewall support. Most notably, though, broadband routers typically incorporate a built-in Ethernet switch. This allows several switches (hubs) to be connected to them, as a means to expand the local network to accommodate more Ethernet devices.

Wi-Fi wireless networks also utilize routers but technically do not have the concept of a wireless switch or hub, although a wireless access point can be roughly compared to a wired switch.
Tweets by @sriramperumalla