|
User #126572 1030 posts
Whirlpool Enthusiast
|
Hi guys. I couldnt find anything really helpful on google how to set the sequence number. Im quite new to Java and all the source code I found are a bit too hard to understand. |
posted 2008-May-14, 5pm AEST
|
|
User #44690 11103 posts
Whirlpool Forums Addict
|
but Im clueless how to set the sequence number. |
posted 2008-May-14, 5pm AEST
edited 2008-May-14, 5pm AEST
|
|
User #126572 1030 posts
Whirlpool Enthusiast
|
Foonly, the sequence number is integer and not generated by the system. For the moment I just set them from 1 to 5. |
posted 2008-May-14, 5pm AEST
|
|
User #44690 11103 posts
Whirlpool Forums Addict
|
Do you mean to assign the sequence number, a new protocol is a must? Can I just assign it with each packet? |
posted 2008-May-14, 6pm AEST
edited 2008-May-14, 6pm AEST
|
|
User #126572 1030 posts
Whirlpool Enthusiast
|
How else is going to get sent? |
posted 2008-May-14, 6pm AEST
|
|
User #44690 11103 posts
Whirlpool Forums Addict
|
I dont use UDP so I *think* Im using TCP |
posted 2008-May-14, 6pm AEST
edited 2008-May-14, 6pm AEST
|
|
User #126572 1030 posts
Whirlpool Enthusiast
|
If it's a "stream" socket -- a Socket instance -- then, yes, it's TCP. |
posted 2008-May-14, 6pm AEST
|
|
User #126572 1030 posts
Whirlpool Enthusiast
|
Ah, I see what you mean. |
posted 2008-May-15, 12am AEST
|
|
User #44690 11103 posts
Whirlpool Forums Addict
|
The client sends a pack of 5 messages in order, but at the server, every 3 times (if i % 3 == 0), the server reorders the sequence number (on the purpose of simulating the so called "real" internet traffic) and sends a NACK to the client, then the client retransmit the previous pack of message again. |
posted 2008-May-15, 9am AEST
|
|
User #36572 3586 posts
Whirlpool Forums Addict
|
As I said before, use TCP and you don't need to think about sequence numbers, ordering, reliability or whatnot in your application code. The whole purpose of TCP is to provide a reliable, ordered stream network protocol. |
posted 2008-May-15, 10am AEST
edited 2008-May-15, 10am AEST
|
|
User #126572 1030 posts
Whirlpool Enthusiast
|
Its not my entire program actually. Later on I need to set up another host, the server reorders the packets and forward to that host. The host will check the sequence numbers, if they are not in order, they will reply with a NACK and request the first host to retransmit packets. |
posted 2008-May-16, 12am AEST
|
|
User #36572 3586 posts
Whirlpool Forums Addict
|
The host will check the sequence numbers, if they are not in order, they will reply with a NACK and request the first host to retransmit packets. |
posted 2008-May-16, 10am AEST
|
|
User #21418 4975 posts
Whirlpool Forums Addict
|
This sounds almost exactly like an assignment I just did (only in C). |
posted 2008-May-16, 12pm AEST
|
|
User #126572 1030 posts
Whirlpool Enthusiast
|
Thanks guys. I worked out how to do it this morning. Its quite simple actually, just add a number at the beginning || end of the message (payload). Gotta KISS huh :P |
posted 2008-May-17, 2am AEST
|
|
User #219305 56 posts
Participant
|
Would have to be an assignment! I think the lecturer is looking at your understanding of the transport layer and windowing. |
posted 2008-May-18, 7pm AEST
edited 2008-May-18, 7pm AEST
|
|
User #44690 11103 posts
Whirlpool Forums Addict
|
Would have to be an assignment! I think the lecturer is looking at your understanding of the transport layer and windowing. |
posted 2008-May-18, 7pm AEST
edited 2008-May-18, 7pm AEST
|
|
User #219305 56 posts
Participant
|
Perhaps SCTP could fit the bill, problem is the industry has been very slow to adopt it. |
posted 2008-May-18, 7pm AEST
|
|
User #36572 3586 posts
Whirlpool Forums Addict
|
. |
posted 2008-May-18, 11pm AEST
edited 2008-May-18, 11pm AEST
|
|
User #30667 3915 posts
Whirlpool Forums Addict
|
I'd shudder if someone was thinking about writing their own proprietary stack in java for a job. |
posted 2008-May-19, 7am AEST
|