2. What is networking?
A collection of machines, links and switches set up so that machines can
communicate with each other.
Nachos provides the abstraction of communication using mailboxes. The Nachos
networking abstraction reaches to closely connected computers. The messaging is
unreliable and messages can be dropped, but they are never corrupted in any way.
The networking provides ordered and fixed-sized messages. There are several
classes that builds the Nachos networking facility.
4. Step 1
Host A is telling the Gateway Server the following: "I'd like to initiate a new
connection with you. My Sequence number is 1293906975"
Step 2
The Gateway Server is telling Host A the following: "I acknowledge your
sequence number and expecting your next packet with sequence number
1293906976. My sequence number is 3455719727".
Step 3.
Host A is telling the Gateway Server the following: "I acknowledge your last
packet. This packet's sequence number is1293906976, which is what you're
expecting. I'll also be expecting the next packet you send me to have a sequence
number of3455719728".
5. Step 4.
Host A generates a packet with some data and sends it to the Gateway Server.
The data tells the Gateway Server which webpage it would like sent.
The sequence number of the segment in line 4 is the same as in line 3 because
the ACK does not occupy sequence number space.
6. W hich files?
First of all we have to implement Locks and Condition
Variables
Which files should we modify?
The files of importance are:
threads directory:
● lockcond.h, lockcond.cc: for defining and implementing
lock and condition synchronization primitives; needed for
network applications to work.
network directory:
● post.h, post.cc: postoffice and mailbox, mail message
definition and implementation.
7. ● nettest.cc: application to test communication between
host id 0 and host id 1
machine directory:
● network.h, network.cc: Data structures to emulate a physical
network connection. The network provides the abstraction of
ordered, unreliable, fixed-size packet delivery to other
machines on the network.
● sysdep.h, sysdep.cc : Interprocess communication
operations, for simulating the network; Unix sockets creation,
binding, closing, etc. are called here to provide nachos socket
functionality.
8. Security
● Encryption
All encryption is based on an algorithm, the function of this
algorithm is basically encode the information to be
indecipherable at first sight.
An encryption algorithm can transform the letter "A" to
"5x5mBwE" or to "xQE9fq" and the work of an encryption
algorithm is precisely determine how information will be
transformed from its original state to one that is difficult to
decode.
9. The encryption and decryption algorithms uses what is called key to encrypt or
decrypt information.
These keys are used to encrypt information, however, there is another key that
the person who receives the message knows, and it is through this unique key
that the message can be decrypted.
10.
11. seudo-code (Server)
P
class Server{
try{
ServerSocket ss = new ServerSocket(8080); /*Create
server*/
Socket s = ss.acept(); /* Create socket */
receiveString();
decodeString();
s.close(); /* Close connection */
ss.close(); }
catch(Exception ex){
ex.printStackTrace();}
}//End of Server
12. seudo-code (Client)
P
class Client{
try{
Socket s = new Socket("localhost", 8080); /*Create
socket*/
encodeString(); /*before send String data must be
encode*/
sendString();
s.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}//End of Client
13. Sources
● http://en.wikipedia.org/wiki/Acknowledgement_(data_networks)
● http://www.firewall.cx/networking-topics/65-tcp-protocol-analysis/134-tcp-
seq-ack-numbers.html
● http://cnx.org/content/m30811/latest/
● http://cnx.org/content/m30811/latest/
For more information go to blog: www.os-ocj.blogspot.com