[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
TCPIP
TCP/IP Fundamentals [/purple]


TCP/IP stands for Transmission Control Protocol and the Internet Protocol. The internet mainly consists of two main protocols in the transport layer. TCP is a Connection oriented protocol, whereas UDP is a Connectionless protocol.

TCP/IP (Transmission Control Protocol/Internet Protocol)
is a set of protocols independent of the physical medium used to transmit data, but most data transmission for Internet communication begins and ends with Ethernet frames.
The TCP is nothing but a connection oriented protocol. The example of the connectionless protocol is UDP User Data Protocol.
The purpose of the TCP is to provide dependable end-to –end byte stream over an unreliable internet.
The internet differs from a single network because different parts may have completely different bandwidths, rules ,  ?network systems,  ?topologies etc. TCP was previously defined in RFC 793.

The Ethernet can use either a bus or star topology. A bus topology attaches all devices in sequence on a single cable. In a star topology all devices are wired directly to a central hub. 10Base-T uses a combination called a star-shaped bus topology because while the attached devices can share all data coming in on the cable, the actual wiring is in a star shape. The access method used by the Ethernet is called Carrier Sense Multiple Access with Collision Detect (CSMA/CD). This is a contention protocol, meaning it is a set of rules to follow when there is competition for shared resources. Bits flowing across the Ethernet are grouped into structures called frames. A frame must be between 46 and 1500 bytes in size. An Ethernet frame has four parts:

  1. A Preamble of 8 bytes that helps synchronize the circuitry, thus allowing small bit rate differences between sender and receiver.
  2. A Header of 14 bytes that contains a 6 byte destination address, 6 byte source address and a 2 byte type field.
  3. A Data area of variable length that, along with the header, is passed to the IP layer.
  4. A Trailer of 4 bytes that contains a CRC to protect against corrupted frames.
If the destination address is all 1 bits, it defines a broadcast frame and all systems on the local network process the frame. There are also multicast frames. A subset of systems can form a "multicast" group that has an address that does not match any other system on the network. All systems in a particular subset process a packet with a destination address that matches their subset. A system can belong to any number of subsets.

A system may put its interface(s) into promiscuous mode and process all frames sent across its Ethernet. This is known as "sniffing the ether." It is used for network debugging and spying.



Collisions [/purple]


In a star-shaped bus topology, all systems have access to the network at any time. Before sending data, a system must determine if the network is free or if it is already sending a frame. If a frame is already being sent, a system will wait. Two systems can "listen" on the network and "hear" silence and then proceed to send data at the same time. This is called a collision. Ethernet hardware has collision detection sensors to take care of this problem. This is the Collision Detect (CD) part of CSMA/CD. The colliding data is ignored, and the systems involved will wait a random amount of time before resending their data.

All TCP connections are full duplex and point to point. TCP does not support Broadcasting of information.
A TCP connection is also a byte stream not a message stream.
TCP service is made by having both the sender and receiver create end points called sockets. Each socket has a socket number (address) consisting of the OP address of the host and a 16 bit number local to the host called a port.
To establish TCP services a connection must be established between a socket of the sending machine and the socket of the receiving machine.


Table lookup

Port Number Listening Application
  • 7 Echo request
  • 20/21 File Transfer Protocol (FTP)
  • 23 Telnet
  • 25 Simple Mail Transfer Protocol (SMTP)
  • 53 Domain Name Server


The TCP layer stack is as follows it is much similar to the Operating System Interconnection layer but at the same time, it is also different.

Table lookup

TCP/IP 5-Layer Reference Model Name of Layer Purpose of Layer
  • Layer 5 Application Specifies how a particular application uses a network.
  • Layer 4 Transport Specifies how to ensure reliable transport of data.
  • Layer 3 Internet Specifies packet format and routing.
  • Layer 2 Network Specifies frame organization and transmittal.
  • Layer 1 Physical Specifies the basic network hardware.


TCP/IP is the protocol depends upon which all Internet communication is based. Different vendors have developed other networking protocols, but even most network operating systems with their own protocols, such as Netware, support TCP/IP. It has become the de-facto standard.

TCP Header [/purple]

Every TCP segment has a header. The header comprises all necessary information for reliable, complete delivery of data. Among other things, such as IP addresses, the header contains the following fields:


Sequence Number [/purple]


This 32-bit number contains either the sequence number of the first byte of data in this particular segment or the Initial Sequence Number (ISN) that identifies the first byte of data that will be sent for this particular connection.

The ISN is sent during the connection setup phase by setting the SYN control bit. An ISN is chosen by both client and server. The first byte of data sent by either side will be identified by the sequence number ISN + 1 because the SYN control bit consumes a sequence number. The following figure illustrates the three-way handshake.
The sequence number is used to ensure the data is reassembled in the proper order before being passed to an application protocol.

Acknowledgement Number [/purple]


This 32-bit number is the other host's sequence number + 1 of the last successfully received byte of data. It is the sequence number of the next expected byte of data. This field is only valid when the ACK control bit is set. Since sending an ACK costs nothing, (because it and the Acknowledgement Number field are part of the header) the ACK control bit is always set after a connection has been established.
The Acknowledgement Number ensures that the TCP segment arrived at its destination.


Control Bits
This 6-bit field comprises the following 1-bit flags (left to right)
  • URG - Makes the Urgent Pointer field significant.
  • ACK - Makes the Acknowledgement Number field significant.
  • PSH - The Push Function causes TCP to promptly deliver data.
  • RST - Rest the connection.
  • FIN - No more data from sender, but can still receive data.
  • SYN - Synchronize sequence numbers
Window Size - This 16-bit number states how much data the receiving end of the TCP connection will allow. The sending end of the TCP connection must stop and wait for an acknowledgement after it has sent the amount of data allowed.
Checksum - This 16-bit number is the one's complement of the one's complement sum of all bytes in the TCP header, any data that is in the segment and part of the IP packet. A checksum can only detect some errors, not all, and cannot correct any.


IP [/purple]

IP provides communication between hosts on different kinds of networks and topologies. It is a  ?connectionless unreliable packet delivery service. Its somewhat like the UDP.

IP Address [/purple]



IP defines an addressing scheme that is independent of the underlying physical address. IP specifies a unique 32-bit number for each host on a network. This number is known as the Internet Protocol Address, the IP Address or the Internet Address.Each packet sent across the internet contains the IP address of the source of the packet and the IP address of its destination.


For routing efficiency, the IP address is considered in two parts: the prefix which identifies the physical network, and the suffix which identifies a computer on the network. A unique prefix is needed for each network in an internet. For the global Internet, network numbers are obtained from Internet Service Providers (ISPs). ISPs coordinate with a central organization called the Internet Assigned Number Authority (IANA).


ARP [/purple]

The Address Resolution Protocol is used to translate virtual addresses to physical ones. The network hardware does not understand the software-maintained IP addresses. IP uses ARP to translate the 32-bit IP address to a physical address that matches the addressing scheme of the underlying hardware (for Ethernet, the 48-bit MAC address.


There are three general addressing strategies:


  1. Table lookup
  2. Translation performed by a mathematical function
  3. Message exchange

TCP/IP can use any of the three. ARP employs the third strategy, message exchange. ARP defines a request and a response. A request message is placed in a hardware frame (e.g., an Ethernet frame), and broadcast to all computers on the network. Only the computer whose IP address matches the request sends a response.




last edited (August 20, 2004) by Doctor Slush, Number of views: 28807, Current Rev: 51 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.