You are to start with the netbounce code,
and adapt that code in netsocketlib.c to
encapsulate the functionality into two objects, the ServerSocket and the ClientSocket.
The objects are struct's, whose datatype is provided. They store all the information about
the socket as well as certain dynamic data, for instance, the address from which was
received the last UDP packet. This is needed in the case of a server for it to respond.
The objects are adapted to client-server computing. The server socket is assigned to
listen on a socket with the server_listen function, and to reply with the server_reply
function.
THe client will make a request to the configured host and port with client_send, and
will gather the server's response with client_receive.
Netbounce-oe
The netbounce program originally had all the code in its file. Now it calls the
netsocketlib library. It is also now only a single binary, the uses the command line
flags to determine its role as either client or server.
AWS Security Groups
In order to establish a communication flow between hosts in the Internet, the flow must be permitted.
Various devices restrict such flows, in order to provide efficiency and security. The AWS solution
of the Security Group is an example of a method of restricting traffic.
You need to identify which securit group is applied to your EC instance. By default, a security
group will be created when the EC instance is created. The security group is associated with your
EC instance until you change it. Security groups can be used by more than once EC instance.
More than one security group can be applied to an EC instance.
A security group is a collection of Inbound Rules. Each rule allows traffic to arrive
at the EC instance. For traffic to pass, it must match,
A protocol. For example the TCP, UDP or ICMP protocols.
A source filter. For example an IP range or an AWS security group.
A port range.
The rule created for an EC instance must allow SSH traffic to come in. Therefore the
automatically created Security Group has in inbound rule to allow TCP port 22 from any
internet host.
For the netbounce, if the server is an EC instance binding to port 3333,
you will add the rule for inbound traffic to allow UDP port 3333 from any internet host.