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-lis listen mode and-pindicates the portnetcatwill listen on, then pipe what is received throughnetcatto 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_sendfile_to_sendand then sends the file usingnetcatto 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