punjab edusat society 1 introduction to tcp/ip by: - er. magandeep kaur g.p.c.g. patiala 7/sept/2012
TRANSCRIPT
Punjab EDUSAT Society 1
Introductionto
TCP/IP By: - Er. Magandeep Kaur
G.P.C.G. PATIALA7/sept/2012
INTRODUCTION
• TCP stands for Transmission Control Protocol and IP stands for Internet Protocol.
• The TCP/IP is a set of protocols that defines how the transmissions take place as well as exchanged across the internet.
• It is very effective and popular set of protocols.
2Punjab EDUSAT Society7/sept/2012
• In fact TCP/IP started with the introduction of ARPANET (Advanced Research Project Agency Network) which was an early research network and the conventions used in this for communication across network, later on the APRANET became TCP/IP.
• Thus the concept of internetworking and TCP/IP were developed together.
3Punjab EDUSAT Society7/sept/2012
• A TCP/IP internet operates like a single network connecting many computers of any size and type.
• The TCP/IP was developed before OSI and it is made up of only four layers named as:
OSI TCP/IPApplication Application
Presentation Not Present
Session
Transport Transport
Network Internet
Data link Host to host
Physical
4Punjab EDUSAT Society7/sept/2012
• A network in TCP/IP internetwork can be LAN, WAN or MAN.
• The data on the network is transported in packets called datagrams.
• A datagrams carries information sufficient for routing from the originating source machine to the destination machine without establishing a connection.
5Punjab EDUSAT Society7/sept/2012
• It is a connectionless service and no call setups are done.
• For proper delivery of data, the datagram includes source address and destination address.
• TCP provides services like stream delivery, buffering, segmentation, connection oriented transfer, reliability, sequence numbering & acknowledgement numbering.
6Punjab EDUSAT Society7/sept/2012
ADDRESSING
• When an application wants to set up a connection to other application it needs address of that.
• Whether it is a connection oriented service or connection less TCP/IP, it needs the address of source and destination points.
7Punjab EDUSAT Society7/sept/2012
• Addressing can be studied in three broad categories in TCP/IP as follows:
1.Physical addressing
2.Logical addressing
3.IP addressing.
8Punjab EDUSAT Society7/sept/2012
PHYSICAL ADDRESSING• The address assigned to a network
interface card by the original manufacturer or by the network administrator is called physical address or hardware address.
• This address identifies the address of the local device to the rest of the network and allows messages to find their correct destination.
9Punjab EDUSAT Society7/sept/2012
• It is a unique identifier for a specific mode on network.
• The physical address is specified by switches or jumpers on the network interface card.
• The format of physical address depends upon to particular type of network.
• For example in an Ethernet LAN a 48 bit physical address is used.
10Punjab EDUSAT Society7/sept/2012
• Three types of physical addresses are:
1.Unicast address
2.Multicast address
3.Broadcast address
1.Unicast address are permanently assigned to the network interface card (NIC) and are unique for a machine.
7/sept/2012 Punjab EDUSAT Society 11
2. Multicast addresses are the addresses given to a group to a group of hosts instead of a single host.
- Thus to receive a datagram they identify a group of stations/machines in the same area/domain.
- This addressing technique is very effective if a common information is to be communicated to a group of hosts.
3. Broadcast addresses is an address, which if given in datagram, the message is communicated to all hosts in the network.
12Punjab EDUSAT Society7/sept/2012
LOGICAL ADDRESSING• To provide a unique identifier for a
specific node on a network by the network operating system is called logical addressing.
• The network operating system establishes logical addresses for different nodes on the network.
• Normally while sending messages to any node on the network, the host only knows the logical address of target computer.
13Punjab EDUSAT Society7/sept/2012
• The host has to find the physical address of the node and for that TCP/IP uses a special protocol named as address resolution protocol (ARP).
• ARP allows a host of find the physical address of node on the same network when it only knows the targets logical address.
• The network interface card contains a table, known as address resolution cache, that maps logical addresses to the hardware addresses of the node on the network.
14Punjab EDUSAT Society7/sept/2012
• Thus if logical address of a node is known, physical address can be traced from the table.
• Routing protocols and routing algorithms are used to deliver, the packet to its destination after finding the logical address and knowing its physical address.
• Thus to reach a node in a network, first of all its logical address must be known.
7/sept/2012 Punjab EDUSAT Society 15
• Thereafter its physical address is found by the host using ARP and then only the required data message can be conveyed to the destination node.
• Thus logical addresses are one that define a logical topology to reach a particular host.
• In terms of networks the logical addresses contain network number, subnet work numbers, super network number, host number etc.
7/sept/2012 Punjab EDUSAT Society 16
• However these numbers are assigned by the network operating system to them, but to reach them the physical address is required which is calculated using some method using the logical number specified in the datagram.
17Punjab EDUSAT Society7/sept/2012
IP ADDRESSING • The data packets in TCP/IP travels in the
form of a datagram.
• A datagram contains many fields along with the actual data packets that help routing and delivery of the packet to the correct location.
• The datagram format contains the source address and the destination address for identification of source host (sender) and destination host (receiver).
18Punjab EDUSAT Society7/sept/2012
• These addresses identify the connection of a host to its network.
• Thus the IP packet header contains an IP network address for the sender and IP network address for the destination.
• These IP network addresses are said to be logical because they are defined in terms of the logical topology of the routers and hosts.
7/sept/2012 Punjab EDUSAT Society 19
• Each host in the internet has a globally unique IP address.
• IP address uniquely identify a host on network.
• The IP address format apparently contains three fields
1.Class type
2.Network – ID
3.Host - ID20Punjab EDUSAT Society7/sept/2012
1. Class type defines the class of the
network in which the host is located.
2. Network ID gives the network
number.
3. Host ID gives the number of the host as specified by the network operating system.
21Punjab EDUSAT Society7/sept/2012
• Every host as well as router has a unique IP address and it encodes the net number (network ID) and host number (host ID) along with the class type of the address.
• No two machines can have same IP address.
• These IP addresses are used in the fields “Source address” and “Destination address” in the IP packets or datagrams.
• Fig. shows an IP address format.
Class Type
Net – id Host – id
22Punjab EDUSAT Society7/sept/2012
Class No. of network bits
No. of host bits
Start bits
A 7 24 0
B 14 16 10
C 21 8 110
D Multi cast 1110
E Future use 11110
7/sept/2012 Punjab EDUSAT Society 23
Network classes
• Class A network allow 126 networks with 16 million hosts.
• Class B network allow 16,382 networks with 64000 hosts.
• Class C network allow 2 million networks with 254 hosts.
• Class D networks are reserved for multicast address.
- In multicasting a datagram is passed to a selected group of hosts instead of passing it to a single or individual host.
7/sept/2012 Punjab EDUSAT Society 24
SPECIAL IP ADDRESSES• In IP addressing 0 and -1 values have special
meanings.
• The value 0 indicates this network or this host while the value -1 indicates a broadcast address to a mean all hosts on the indicated network.
• Thus the IP address containing all zeros or the address 0.0.0.0 is used by the hosts only when they are being booted but is not used afterwards.
25Punjab EDUSAT Society7/sept/2012
SPECIAL IP ADDRESSES• The concept that shows special IP addresses.
(a) This Host
(b) A host on this network
(c) A host on this network
(d) Broadcast on a local network
(e) Broadcast on a distant network
(f) Loopback
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0
0 0 0 0 0 0 0 0 Host – id
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Host – id
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Network – id 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 Anything
26Punjab EDUSAT Society7/sept/2012
SUBNETTING • IP address contains three information
called - class type, network – id and host-id.
• To deliver the message/data packet to its destination first of all the network is located according to the network id number.
• When the packet reaches the required network it locates for the host (destination) using second position of address i.e. host – id.
27Punjab EDUSAT Society7/sept/2012
• This clearly shows that there is concept of hierarchy in IP addressing.
• This concept is used to solve a major problem that may occur in case the network grows.
• In fact in IP addressing all the hosts in a network must have the same network address and as the network grows this addressing technique may cause a problem.
7/sept/2012 Punjab EDUSAT Society 28
• For example, let a company/office starts a C class network on internet and after sometime it reaches the limit of hosts in it.
• Now it, needs second C class address and for that it needs to acquire a second LAN with separate IP address.
• If the need of company still grows then it may result into many LAN’s with their own network number as well as router.
29Punjab EDUSAT Society7/sept/2012
• The management of such networks becomes really difficult as their number grows as every time the new network is installed.
• A new network number is required and NIC must be contacted.
• Another problem may arise if any machine is moved from one LAN to other as it needs address change (network address).
30Punjab EDUSAT Society7/sept/2012
• To remove such problems the concept of subnetting was introduced.
• In subnetting a network A is splitted into several parts for internal use but for the internet/outside world it acts as single network.
• These smaller networks or parts inside a network are called subnet or sub networks.
• The hierarchy of IP addressing as mentioned in the beginning can help a lot to implement the concept of subnetting.
31Punjab EDUSAT Society7/sept/2012
• Sub-netting is the process of dividing the large network into smaller networks which have their own address called subnet address.
• It means in an IP address 198.21.81.120….. The network id is 198.21, sub-network id is 81 and host-id is 120.
7/sept/2012 Punjab EDUSAT Society 32
Network-ID Subnet-ID Host-ID
SUPERNETTING • It is the reverse concept of
subnetting.
• It combines many networks in a region to form a single address.
• Like sub-netting it is also a hierarchical type addressing but the process and method of address resolution is just the reverse.
33Punjab EDUSAT Society7/sept/2012
Loopback • Loopback testing is one of the
powerful concepts for fault isolation in networks.
• The loopback testing circuits allow to perform a loopback test in the network.
• The IP addresses of the format 127.X.Y.Z are reserved for loopback testing.
34Punjab EDUSAT Society7/sept/2012
Local Loopback testing
• To explain the concept let us assume that a sender machine sends data packet to a remote host and the operation suddenly ceases or fails.
Transmitter Transmitter
Receiver Receiver
Sender
Host
Data packet
Transmission line
35Punjab EDUSAT Society7/sept/2012
• Now the problem could be in the local host (sender-modem), transmission channel, remote host or in the remote modem.
• The network manager can use loopback tests to isolate the fault.
• The local loopback checks the functioning of local network and network devices while the remote loopback tests the operation of the transmission channel and remote network device like modems, routers etc.
36Punjab EDUSAT Society7/sept/2012
IPV4 PACKET FORMAT• The format used by the IP datagrams that
carry the data messages in the network is called IP packet format.
• It is different for different protocols.• An IP data gram consists of header part
and text part. • Header part is further divided into two
parts:
1.Fixed part (20 bytes long)
2.Variable length part (optional)37Punjab EDUSAT Society7/sept/2012
• Fixed part: The twelve fields of header format are as follows:
1.Version: It is 4bit field. It helps to send the packets even on older machines by knowing the version used on them.
2.IHL: It is Internet Header Length. It tells the length of header.
3.Types of service: It is one byte or 8bit field. It specifies reliability, speed or delay etc parameters and is rarely used.
38Punjab EDUSAT Society7/sept/2012
4. Total length: It is 16 bits or 4 byte field that tells the total length of the datagram including everything i.e. header and data fields.
5. Identification: It is also 16 bits field that allow destination host to identify the datagram of currently arrived fragment.
6. Flags: It is a 3 bit field that contains one unused bit, 1 bit for DF(don’t fragment) and 1 bit for MF(more fragment).
7/sept/2012 Punjab EDUSAT Society 39
- If DF bit is marked 1, the sender knows that the datagram will reach in one piece and if the MF bit is marked 1 then it means there are more fragments of the datagram.
7. Fragment offset: It is 13 bit field.
8. Time to live: It is 8 bit field that specifies the maximum duration, a datagram can remain in network.
9. Protocol: It is 8 bit field.7/sept/2012 Punjab EDUSAT Society 40
10.Header checksum: It is 16 bit field that detects error that may occur during transmission.
11.Source address: It is a 32 bit field that
specifies the address of sender machine
including class type, network ID and
host ID.
12.Destination address: It is a 32 bit field
that specifies the address of destination
machine.7/sept/2012 Punjab EDUSAT Society 41
OPTIONAL PART • The options defined for this field are as
follows:
1.Security: It tells how secret the information is i.e. it tells the secrecy level of the datagram.
2.Strict source routing: This option gives the complete path from source to destination host as a sequence of IP addresses.
42Punjab EDUSAT Society7/sept/2012
- It thus helps the datagram to follow the exact route.
- It also helps the system manager to send the emergency packets in case the routing tables get corrupted.
3.Loose source routing: This option gives a list of all the routers not to be missed in the path.
- The datagram traverse all the specified routers and in the same sequence.
43Punjab EDUSAT Society7/sept/2012
- For example to send a packet from Delhi to Chandigarh it might specify Panipat and Ambala to avoid the wrong processing in south, east or west directions.
44Punjab EDUSAT Society7/sept/2012
7/sept/2012 Punjab EDUSAT Society 45
THANKS