cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
435
Views
3
Helpful
3
Replies

tcp/ip

carl_townshend
Spotlight
Spotlight

Hi all, I was reading up on tcp/ip, it says tcp is connection orientated and ip is connectionless, I thought that all packets that go over routers etc will always use tcp ? does this just mean that the initial connection over layer 3 (ip) is connectionless, then the packets are transferred by tcp which needs to set up the connection ?

3 Replies 3

paul.matthews
Level 5
Level 5

IP Is L3 and connectionless, TCP Is L4 and connection oriented. Other L4 protocols are availabble (eg UDP) that are not connection oriented.

A router forwards packets at L3, and in its simplest form couldn't care less about connections, all it has is a packet to forward.

so do all packets have a tcp port value in them ? I thought that with tcp the connection has to be set up, I gather this happens after ip has got the packet to the destination, am i right ?

cheers

If using TCP, there will be a TCP Port, If using UDP there will be a UDP port. ICMP does not use ports.

To set up a conenction using TCP, three steps are involved.

I will assume a PC doing telnet.

First the PC sends a TCP sends a syn with a destination port of 23, and a source port of its choosing - typicallyy above 2048. I'll use 2069. I will also use "host" and "PC" instead of addresses.

So we get:

TCP-Syn DA - host, SA - PC , DP - 23, SP - 2069

(da - dest address, SA Source address, DP dest port, SP Source port)

Assuming the host is happy to accept the connection, it will respond:

TCP-SynAck DA - PC, SA - Host , DP - 2069, SP - 23

When the PC gets that, it acknowledges the SynAck to complete the three way handshake:

TCP-Ack DA - host, SA - PC , DP - 23, SP - 2069

At that point we have a connection. The router probably couldnt care less, normally all it is bothered about (assuming no access lists or QoS etc is:

IP DA - host, SA - PC

IP DA - PC, SA - Host

IP DA - host, SA - PC

so it will just forward them.

If the PC pings the host, all the router will care about is:

IP DA - host, SA - PC

IP DA - PC, SA - Host

Look familiar?

Where what is carried is:

ICMP DA - host, SA - PC - ECHO REQUEST

ICMP DA - PC, SA - Host - ECHO RESPONSE

Paul.

Review Cisco Networking products for a $25 gift card