UDP protocol and TCP IP protocol

Category: VC/MFC -> Network Author: wwweeeqqq002 Date: 2004-04-08 16:21:04
 
wwweeeqqq002
2004-04-08 16:21:04
The task at hand is this :
requires the machine to receive data from the network port , and then sent from another network ports are used to receive and send udp protocol , I made ​​reference to the tftp protocol , made ​​such a program :

native PC to receive part :

1. PC A to B the machine issues a write request, the port is 69
2.   B machine to machine A issued a response , block number is 0,
3. point connection is established, data is divided into 512 -byte fixed-length data packet transmission . Packet sequence number , after B receives the packet sent confirmation to A, A sends a data packet must be acknowledged under B for a packet before. If an error packet loss , use a timeout mechanism. If a packet is lost during transmission , issued last side will retransmit unacknowledged packets after a timeout . But the brothers say

my program is tcp   ip , and undesirable , write udp   agreement broadcast ?
I am dizzy , my program did not establish a connection with the connect (), listen (), Is not no connection for it ? In the end what is the udp protocol ah?
I also see this is the case : "TFTP (Trivial   File   Transfer   Protocol, Trivial File Transfer Protocol ) is a TCP / IP protocol suite , is used between the client and the server for simple file transfer protocol , which is based on UDP protocol to achieve ", TCP / IP protocol suite based on UDP protocol how can achieve it ?

you master , help me !
yesidoliu
2004-04-08 16:34:06
socket you create is how to create ? Creating a UDP socket
should use socket (IPPROTO_UDP AF_INET,  ; SOCK_DGRAM, & nbsp).

correct a concept called TCP / IP protocol suite , including IP / TCP / UDP and other protocols , not to TCP / IP protocol with UDP split open.
HJX5525
2004-04-08 16:46:05
are used to receive and send udp protocol !!
addition is your brothers mean, let you send UDP broadcast packets, not the point of the UDP!

I guess you understand the intent brothers wrong !

PS: an evening called on senior dinner , ask !
unluckyy
2004-04-08 16:50:19
tcp / ip protocol suite including transport layer transport protocol tcp and udp2 species , you should do is to establish a network connection via tcp protocol , adopted at the time of transmission protocol udp transmission of it !
herberthome
2004-04-08 16:56:29
I am using the socket (AF_INET,   SOCK_DGRAM,   IPPROTO_UDP) to create a UDP socket.   This network interface matter? Establish a network connection via udp protocol , when the transmission udp protocol used to transfer the how to do ah

womiwang
2004-04-08 17:15:13
socket
bind
sendto
recvfrom
close
call these types of interface , you should doubt the correctness of your brothers , then , huh
mazhuo0830
2004-04-08 17:27:31
Brother acceptance of my work , is half owner, estimated that he Yes
my program is this :

m_psocket- > Create (2330,   SOCK_DGRAM);
                m_psocket- > SendTo (sendbuf,   len,   port,   ip);
ret   =   m_psocket- > ReceiveFrom (recvbuf,   1024,   ip,   port);

right?
kennedy336
2004-04-08 17:47:15
Your brothers know anything ah, estimated to have you teach him! Oh
ratass
2004-04-08 17:55:52
Thank you , my program is indeed the UDP .
there is another question about the tftp , I ask it to open another post .
hcb8700
2004-04-08 18:08:02

fact, the UDP and TFTP his brother , confused , you should talk to your brothers so interpreted , surely you can convince him :
1, UDP is not connection-oriented , but also that is when he is not going to bother sending if the recipient is able to receive data. The TCP is a connection-oriented , reliable, take the three-way handshake is the way to ensure reliable transmission of data reported .
2, points clear all UDP and TCP transport layer protocol , then , in order to ensure that UDP packets during transmission can also be reliable, it must rely on the application layer , and you say TFTP is the application layer protocol , and is specifically aimed at the UDP transport protocol data is written . He is at the application layer to ensure the reliability of data transmission. So long as you are using the UDP transport layer protocol , then he is UDP transport , not because since the application layer and the TCP taken a similar manner to become a TCP, therefore , brothers understand you have a problem , tell the bold words your brothers , in fact brothers say is not necessarily correct , dare doubt