Frequently Asked Questions #16
Locked
Pusnow
announced in
[Announcements]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
1. Getting Started
Q1-1: How do I ask questions?
We use Github Discussions for project-related Q&A.
You can search previously asked questions or open a new discussion.
Q1-2: How do I use Github Discussions?
See https://docs.github.com/en/discussions/quickstart#creating-a-new-discussion
Q1-3: Which category should I use?
There are four categories: Application (for PA1), TCP (for PA2 and PA3), Routing (for PA4), and etc.
You should choose a category based on your assignment.
Q1-4: I need more resources
We also maintain WiKi (https://github.com/ANLAB-KAIST/KENSv3/wiki).
Q1-5: How do I get notified?
Use Watch button on the top.
2. Application Layer
Q2-1: Will the code style be graded?
No.
Q2-2: Is there any extra test cases?
No, passing provided test cases is enough.
Q2-3: Which file do I have to submit?
You only have to submit
EchoAssignment.cpp.Q2-4: Which part do I need to edit?
You only have to edit
serverMainandclientMainmethods.KENSv3/app/echo/EchoAssignment.cpp
Lines 24 to 42 in 3098c76
Q2-5: Can I use
fork(),select(),poll(), orepoll()? I want to do I/O multiplexingNo, currently KENS does not support these system calls.
Q2-6: Can I use non-blocking sockets?
No, currently KENS does not support non-blocking sockets.
Q2-7: Can I use
getsockoptandsetsockopt? I want to setSO_REUSEADDRoptionNo, currently KENS does not support these functions.
3. Transport Layer
Q3-1. [Handshaking] How much implementation is required in this project?
See https://github.com/ANLAB-KAIST/KENSv3/wiki/Misc:-Statistics
Q3-2. [Handshaking] Can we assume that there are only IPv4 addresses?
Yes
Q3-3. [Handshaking] As far as I know,
socket()gets three arguments, domain, type and protocol, while the KENS template(TCPAssignment.cpp) gets only two arguments except for syscallUUID and PID. Do I have to omit one of those arguments in the project?Domain argument is processed automatically by KENS.
Q3-4. [Handshaking] I don’t understand how simultaneous connect/close work
Please refer to the following material to understand them. https://tools.ietf.org/html/rfc793 (page 32)
Q3-5. [Handshaking] Should we only implement these 4 (
accept()/connect()/getpeername()/listen()) or we have to implementpacketArrived()or the others as well?You are going to have to write code in
packetArrived()function as blocked system calls are called when they receive appropriate packet from its peer(can be either server or client)Q3-6. [Handshaking] Is it necessary to check for overlap when implementing implicit bind in
connect()?Yes, you should check the overlap.
Q3-7. [Handshaking] How similar should the pcap files be to the solutions? Should we try to calibrate the sequence number of packets to match the ones in the pcap files so that we get the exact same bytes? or is it enough for the pcap file to show the correct packet send/receive ordering?
You can't have exactly the same pcap files since your sequence numbers will be different. But, we will compare the order of packets, and apart from multi-interface test cases, you are supposed to have the exact same order with the solution pcap files.
Q3-8. [Handshaking] Can multiple processes listen to the same port?
No.
Q3-9. [Handshaking] Do we have to reimplement checksum function from scratch?
No. You can use function
NetworkUtil::tcp_sum. See https://github.com/ANLAB-KAIST/KENSv3/wiki/Tip:-Networking-Utilities#tcp-checksum-calculation .Q3-10. [Handshaking] I had trouble with checksum value. When I tried to send the packet, checksum value sometimes automatically changed to 0xeeee
Comment the line
#define UNRELIABLEin testenv.hpp.Q3-11. [Handshaking] What should a process do after calling
listen?After calling
listen, a process waits for incoming connections by callingaccept, which returns a descriptor that references a new socket connected to a client. The original socket,s, remains unconnected and ready to receive additional connections.acceptreturns the address of the foreign system ifnamepoints to a valid buffer.The connection-processing details are handled by the protocol
Q3-12. [Transfer] In the test for sending (e.g. TestTransfer_Accept_Send_Symmetric), I got ACK packets from the receiver after sending all data to the receiver. However, in the solution pcap file, it sends only some packets and gets ACK. Why does this happen?
The solution already has congestion control implemented, so it has features like slow start.
Q3-13. [Transfer] My implementation has no FIN packets, because
read()is blocked and it is never unblocked because the remote peer closes the connection and no more sends data, resultingclose()is never able to be called. What is the problem in this case?You must understand EOF behavior. If the remote host sent FIN, this indicates that the remote host declared the end of the file. In the receipt of FIN, the read should not be blocked but return -1 to indicate that the remote host has closed the connection.
Q3-14. [Transfer] Is there any case such that the sender sends 512 bytes but the receiver receives less than 512 bytes?
The incomplete packet error that you mentioned should not happen because both Ethernet and IP layers check the packet length. Sure, it could miraculously happen but the probability would be extremely low.
Q3-15. [Transfer] Can packets engaged in connection setup/teardown also be lost?
Yes, you should handle SYN, SYNACK, or FIN losses.
4. Internet Layer
Q4-1. [Routing] Which protocol do we implement?
RIPv1 and modified version of RIPv1
Beta Was this translation helpful? Give feedback.
All reactions