Why do we say the IP protocol in TCP/IP suite is connectionless?

前端 未结 7 1501
無奈伤痛
無奈伤痛 2021-01-31 00:22

Why is the IP called a connectionless protocol? If so, what is the connection-oriented protocol then?

Thanks.

Update - 1 - 20:21 2010/12/26

I think, to b

相关标签:
7条回答
  • 2021-01-31 00:46

    When two hosts want to communicate using connection oriented protocol, one of them must first initiate a connection and the other must accept it. Logically a connection is made between a port in one host and other port in the other host. Software in one host must perform a connect socket operation, and the other must perform an accept socket operation. Physically the initiator host sends a SYN packet, which contains all four connection identifying numbers (source IP, source port, destination IP, destination port). The other receives it and sends SYN-ACK, the initiator sends an ACK, then the connection are established. After the connection established, then the data could be transferred, in both directions. In the other hand, connectionless protocol means that we don't need to establish connection to send data. It means the first packet being sent from one host to another could contain data payloads. Of course for upper layer protocols such as UDP, the recipient must be ready first, (e.g.) it must perform a listen udp socket operation.

    • The connectionless IP became foundation for TCP in the layer above
    • In TCP, at minimal 2x round trip times are required to send just one packet of data. That is : a->b for SYN, b->a for SYN-ACK, a->b for ACK with DATA, b->a for ACK. For flow rate control, Nagle's algorithm is applied here.
    • In UDP, only 0.5 round trip times are required : a->b with DATA. But be prepared that some packets could be silently lost and there is no flow control being done. Packets could be sent in the rate that are larger than the capability of the receiving system.
    0 讨论(0)
  • 2021-01-31 00:46

    In my knowledge, every layer makes a fool of the one above it. The TCP gets an HTTP message from the Application layer and breaks it into packets. Lets call them data packets. The IP gets these packets one by one from TCP and throws it towards the destination; also, it collects an incoming packet and delivers it to TCP. Now, TCP after sending a packet, waits for an acknowledgement packet from the other side. If it comes, it says the above layer, hey, I have established a connection and now we can communicate! The whole communication process goes on between the TCP layers on both the sides sending and receiving different types of packets with each other (such as data packet, acknowledgement packet, synchronization packet , blah blah packet). It uses other tricks (all packet sending) to ensure the actual data packets to be delivered in ordered as they were broken and assembled. After assembling, it transfers them to the above application layer. That fool thinks that it has got an HTTP message in an established connection but in reality, just packets are being transferred.

    0 讨论(0)
  • 2021-01-31 00:48

    TCP is the connection part of TCP/IP. IP's the addressing.

    Or, as an analogy, IP is the address written on the envelope, TCP is the postal system which uses the address as part of the work of getting the envelope from point A to point B.

    0 讨论(0)
  • 2021-01-31 00:57

    TCP/IP means "TCP over IP".

    TCP
    --
    IP
    
    • TCP provides the "connection-oriented" logic, ordering and control
    • IP provides getting packets from A to B however it can: "connectionless"

    Notes:

    • UDP is connection less but at the same level as TCP
    • Other protocols such as ICMP (used by ping) can run over IP but have nothing to do with TCP

    Edit:

    • "connection-oriented" mean established end to end connection. For example, you pick up the telephone, call someone = you have a connection.

    • "connection-less" means "send it, see what happens". For example, sending a letter via snail mail.a

    So IP gets your packets from A to B, maybe, in any order, not always eventually. TCP sorts them out, acknowledges them, requests a resends and provides the "connection"

    0 讨论(0)
  • 2021-01-31 00:58

    The basic idea is pretty simple: with IP (on its own -- no TCP, UDP, etc.) you're just sending a packet of data. You simply send some data onto the net with a destination address, but that's it. By itself, IP gives:

    1. no assurance that it'll be delivered
    2. no way to find out if it was
    3. nothing to let the destination know to expect a packet
    4. much of anything else

    All it does is specify a minimal packet format so you can get some data from one point to another (e.g., routers know the packet format, so they can look at the destination and send the packet on its next hop).

    TCP is connection oriented. Establishing a connection means that at the beginning of a TCP conversation, it does a "three way handshake" so (in particular) the destination knows that a connection with the source has been established. It keeps track of that address internally, so it can/will/does expect more packets from it, and be able to send replies to (for example) acknowledge each packet it receives. The source and destination also cooperate to serial number all the packets for the acknowledgment scheme, so each end knows whether packets it sent were received at the other end. This doesn't involve much physically, but logically it involves allocating some memory on both ends. That includes memory for metadata like the next packet serial number to use, as well as payload data for possible re-transmission until the other side acknowledges receipt of that packet.

    0 讨论(0)
  • 2021-01-31 01:00

    Connectionless means that no effort is made to set up a dedicated end-to-end connection, While Connection-Oriented means that when devices communicate, they perform handshaking to set up an end-to-end connection.

    IP is an example of the Connectionless protocols , in this kind of protocols you usually send informations in one direction, from source to destination without checking to see if the destination is still there, or if it is prepared to receive the information .

    Connectionless protocols (Like IP and UDP) are used for example with the Video Conferencing when you don't care if some packets are lost , while you have to use a Connection-Oriented protocol (Like TCP) when you send a File because you want to insure that all the packets are sent successfully (actually we use FTP to transfer Files).

    Edit :

    In telecommunication and computing in general, a connection is the successful completion of necessary arrangements so that two or more parties (for example, people or programs) can communicate at a long distance. In this usage, the term has a strong physical (hardware) connotation although logical (software) elements are usually involved as well.

    The physical connection is layer 1 of the OSI model, and is the medium through which the data is transfered. i.e., cables

    The logical connection is layer 3 of the OSI model, and is the network portion. Using the Internetwork Protocol (IP), each host is assigned a 32 bit IP address. e.g. 192.168.1.1

    0 讨论(0)
提交回复
热议问题