Training session 25: TCP/IP
Learn the basics of this Protocol Suite
So you ask, what actually is TCP/IP? Well its a protocol suite used for transportation of data. Although there are others such as IPX/SPX, TCP/IP is the most frequenctly used these days due to is connection orrientated and error checking features. TCP/IP stands for Transmission Control Protocol/Internet Protocol. This is the common name for the suite of protocols developed by the U.S. DoD in the 1970s to support the construction of worldwide internetworks. Let us examine these two protocols:
The Internet Proctocol is connectionless orientated and, as its major feature provides an addressing scheme. Connectionless orientated means that the packet is sent without any need for confirmation, so for example when you break into a building, you dont exactly wait to see if you have set off the alarm before escaping.
The Transmission Control Protocol is connection orrientated, and provides for error checking of data. A connection orientated protocol waits for confirmation before proceeding, so for example, if you buy a computer game over mail order, you send the money away and wait for the game, if the game doesnt arrive you proceed to abuse the manufacturer until you have your game.
You probably are thinking, so why the heck is this useful? Well when creating networks, it is useful to know how the addressing scheme works and what subnets are. I would roughly guess that for the mass of you that are reading this, that have setup a LAN before, you would have been using windows, and would have gone into network setup, and in properties of TCP/IP would have set your IP to something like 192.168.0.6 and set the subnet to 255.255.255.0 like your mate told you to. Well this probably didnt make sense to you, and all you know is that the last number of 192.168.0.6 has to be diferent than everyone elses at the LAN.
Your IP address is like your street address of your house. When a letter is sent to you, they rely on this address to tell were the mail should be sent. Your IP address identifies which computer should recieve what packets. An ip address is 32 bit and has two sections defined by your subnet mask, these are the network address, broadcast and the node address, and example is the following:
This may seem confusing, so i will explain to you what a subnet is. A subnet is an address that has a logical "AND" performed with it and the IP to give the network and broadcast address. The network address is network to which something belongs to, for example, in a company each department may be connected, but each department may have its own network address so that data from network A doesnt reach network B. This relieves congestion over a network. A broadcast address is the destination address that a packet can be sent to so that all computers on that network recieve it. Here are the maths of the IP address:
First these have to be converted to binary:
Now a logical and is performed on the two, this means whenever both corresponding digits are 1 then the result is 1, otherwise the result is 0. The Result is:
When converted back this is:
Now to find the broadcast address, we will add the maximum number of ip address's on that network which is 255 (2^8), so the broadcast is:
This still really aint that interesting, so lets change the subnet mask to 255.255.255.224 and see what happens:
Although its still the same, lets see what the broadcast addres is:
This is a little more interesting, so lets try a diferent node number:
And the broadcast is:
Here is a list of all the networks and broadcast addresses for 255.255.255.224:
Subnet 1: 192.168.1.0
Subnet 2: 192.168.1.32
Subnet 3: 192.168.1.64
Subnet 4: 192.168.1.96
Subnet 5: 192.168.1.128
Subnet 6: 192.168.1.160
Subnet 7: 192.168.1.192
Subnet 8: 192.168.1.224
Although this all seemed pretty pointless, it is actually rather useful when creating large networks. Your very net connection would have an address like 22.214.171.124 with a subnet of 255.255.255.0 and a gateway of 126.96.36.199. The gateway is what connects your network to other networks. The standard subnets are as follows:
This ranges from 0.0.0.0 to 188.8.131.52 with a subnet of 255.0.0.0
This ranges from 184.108.40.206 to 220.127.116.11 with a subnet of 255.255.0.0
This ranges from 192.0.0.0 to 18.104.22.168 with a subnet of 255.255.255.0
The ranges of these networks are a standard, unlike some retards belief, you can create a Class A network such as 22.214.171.124. Over the internet this however will not be accepted, but at a home network it is viable. So if something says to scan a Class B subnet starting at an address such as 126.96.36.199 then that just means scan from 188.8.131.52 to 184.108.40.206. It DOES NOT refer to the proper addressing scheme like an unbelievable ammount of morons think. 127.0.0.0 is reserved for loopback and special purposes.