[ee122] Project 2 Question regarding MNL and the extra 2 bytes for the port.
ericcheung at berkeley.edu
Tue Dec 4 21:11:36 PST 2007
The two bytes for the port are added by TestSend.c; they aren't provided
by MNL. You'll have to add the port number yourself in your packets.
phamductri at berkeley.edu wrote:
> Hello. So I'm having an issue with MNL and grabbing the port of the sender
> to be able to send ACKs back to the receiver. I have stop and wait working
> just fine with different files for plain vanilla UDP.
> Now, for background info for my question.. The spec says that when we use
> MNLSendto() that the first two bytes that we get from recvfrom() will
> contain the port number of the sender, because the struct sockaddr_in
> populated from the recvfrom() call will refer to the port that the
> MNLDaemon is running on... r
> So far our project is abracted to have a packet class, and each packet can
> send and receive itself (more or less). I have statements in both send and
> recv (in the packet class) before the call to MNLSendto(), and after the
> call from recvfrom() respectively to print out the length of the buffer
> being sent/received. They report the exact same length.
> Why isn't the extra 2 bytes being padded to provide the port? Am I missing
> Also, in TestRecv.c, there is no conversion from network order to host
> order. Shouldn't that also be a concern?
> I'm referring to the newest version of MNL btw. Version B.
> Thanks very much for your time.
> Anthony Kilman
> ee122 mailing list
> ee122 at mailman.ICSI.Berkeley.EDU
More information about the ee122