Note although we didnt ask you to do it for this

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: to fill the packet with the right server address, port. On the server side, it replies, telling the OS to fill in the client address, port Our interface is UDP- like, just a bit simpler. The reason for not using TCP will become obvious later, as we’ll need to use messages for implementing certain protocols. Note although we didn’t ask you to do it for this assignment, you will need to be able to do RPC’s from multiple clients to the same server. That is, the server will need to keep different conversations distinct. [More on that in a sec.] TCP sets up a bidirectional byte stream between two nodes. For TCP, it actually contacts the server when you connect. This allows state to be set up on the remote side. Hint: for at most once, you need state on the remote side to make your RPC work! (That is to say, even though we’re using UDP – you probably need a message exchange to start things off, to be able to deal with failures correctly.) [skip] With TCP the client does: Socket = socket(TCP) Connect(socket, server address, port #) – exchanges start messages Send data (socket) – do the RPC Read data (socket) – wait for the reply On the server side: Socket = socket(TCP) Listen(socket) – marks this as a server Fd = accept an incoming connection(socket) Read data (fd) Do operation Write reply on fd [end skip] 3) What if there are multiple clients...
View Full Document

Ask a homework question - tutors are online