Practice Exercise 1: netcat
Objectives
Set up a simple distributed system on instances to learn more about its components and principles.
Scenario
- You have two instances serving as client (
web1
) and server (db1
) respectively. <name>-a1t-inf-ds-web1.acad.opswerks.net
<name>-a1t-inf-ds-db1.acad.opswerks.net
Tasks
-
SSH into the db1 instance and enter the command below:
The flagsnc -l -p 12345 > file_received
-l
is listen mode and-p
indicates the portnetcat
will listen on, then pipe what is received throughnetcat
to a file namedfile_received
-
SSH into the web1 instance and enter the commands below:
The first command creates a file namedecho "Mekus mekus, tornado" > file_to_send nc <name>-a1t-inf-ds-db1.acad.opswerks.net 12345 < file_to_send
file_to_send
and then sends the file usingnetcat
to the hostname indicated.
Conclusion
This practice exercise helps you understand and differentiate between TCP and UDP and how they are used in implementation of different systems