TCP vs IP question
I'm kind of confused of what's the different job TCP and IP do. Any one can explain this for me using an virtual example, such as a driver driving a car on the road.?
One more question, in my book, it says, if IP knows the destination of the datagram, it sends the datagram on its way, if it doesn't know, IP sends the datagram to the host's default gateway. Does it mean the datagram can travel a shorter way if IP understands its header rather than a longer route if IP doesn't : Can Tracert show me if the datagram has taken a shorter route?
Thanks all.
One more question, in my book, it says, if IP knows the destination of the datagram, it sends the datagram on its way, if it doesn't know, IP sends the datagram to the host's default gateway. Does it mean the datagram can travel a shorter way if IP understands its header rather than a longer route if IP doesn't : Can Tracert show me if the datagram has taken a shorter route?
Thanks all.
BS in Information Technology
Certs: A+, Network+, MCP(70-270, 70-290)
Certs: A+, Network+, MCP(70-270, 70-290)
Comments
-
Webmaster Admin Posts: 10,292 Adminin my book, it says, if IP knows the destination of the datagram, it sends the datagram on its way, if it doesn't know, IP sends the datagram to the host's default gateway. Does it mean the datagram can travel a shorter way if IP understands its header rather than a longer route if IP doesn't
If the destination IP is not on the same subnet as the source IP, the source will assume it needs to be routed to a different subnet (broadcast domain, ie. LAN on other side of WAN link) and hence will send it to the default gateway (which is typically a router). All traffic that isn't destined for the local network is sent to the default gateway. Only then it is routed, hence only then there's a route, hence only then tracert applies.
IP is like sending packets by snail mail. You address a 'packet', send it, and hope it gets delivered. TCP is like a phone call, you don't start transferring data until the destination confirmed the communication channel. There is no "TCP vs IP", no 'versus' as they are used in conjuction. TCP provides connection-oriented guaranteed delivery services for IP.
For more info and the difference between TCP and IP:
www.techexams.net/technotes/networkplus/tcpipsuite.shtml
www.techexams.net/technotes/networkplus/osimodel.shtml -
dissolved Inactive Imported Users Posts: 228IP carries TCP.
I know the term TCP/IP term is confusing. Try not to compare them that way. They are on two different levels of the networking model. TCP/IP does not refer to two protocols (tcp and ip). TCP/IP represents a "suite" of protocols (arp, ip,tcp,udp,icmp etc etc)
Here's an example of how tcp and ip work together:
Say I am in the middle of a telnet session, and I type "a." Say "a" is one byte.
"a" gets encapsulated by the transport layer. In this case, it's TCP since telnet is designed to use this protocol (tcp)to communicate. Once the transport layer encapsulates it, it becomes a segment. Just to re-state, it is so far at 21bytes (20 byte tcp header plus 1 byte data). The tcp header includes source and destination port number, options etc..
the transport layer passes down the "segment" to the network layer.
the network layer receives the segment. It knows it has to use IP to reach the other computer. How? It checks it's local routing table and does not see an entry for the dest IP. It encapsulates it with it's own header. The header includes the source and dest IP address etc and any options. Once the network layer adds it's own header, it becomes a datagram.
The network layer passes it off the ip datagram to the physical layer. Which "frames" the packet. This basically makes it a complete "packet" at this point.
It gets sent as electrical signals across the media (cat5 etc)
note: If your computer realizes that the computer is not on your network, it will send it to the gateway. The gateway will re-frame the packet and send it to the next hop.
So TCP is sometimes used (depending upon the application you're using). And IP is pretty much always used nowadays. TCP basically is used when you need to gurantee delivery. It tracks each byte of data. If each byte isnt received within a certain period of time, TCP will re-send it.
Your best bet is to run a sniffer while you watch traffic cross the wire -
victorou Member Posts: 15 ■□□□□□□□□□
thank you so much, guys. very clear explanations. It helps me a lot.
Actually, I'm trying to look for a real life example(online) which can be used to simulate the OSI model. It's easier for memorizing.
VictorBS in Information Technology
Certs: A+, Network+, MCP(70-270, 70-290)