Invitation to Cybersecurity

INVITATION TO CYBERSECURITY 36 Figure 2.12 A traceroute from Cedarville to Los Angeles. 2.4.3 The Network Edge “It was really hard explaining the Web before people just got used to it because they didn’t even have words like ‘click’ and ‘jump’ and ‘page.’” - Tim Berners-Lee, the inventor of the World Wide Web Programs implement the application layer and interface with the transport layer to send and receive messages. Due to the Internet’s layered design, programmers do not need to worry about sending electronic pulses over wires (Layer 1), communicating bits over a link (Layer 2), routing packets through the network core (Layer 3), or creating a communication channel with the destination process (Layer 4)—all this happens through services provided “under the hood.” This frees the programmer to concentrate on sending and receiving application-level messages. Programming for communicating over a network is called socket programming. The word socket was coined because it is a helpful word picture, as in plugging a cable into a socket like in the old-fashioned telephone switchboards. Table 2.7 shows two minimal socket programs written in Python: a server program and a client program. A server program is a program that listens for incoming network connections and a client program is a program that initiates network connections to servers. Both programs import the socket software library so they can call its procedures. The client connects to the server at 163.11.13.37:2600 (IP address:port number) and sends the message “LO” which is then received and printed by the server, recreating the first ever computer network message. Much work has to happen in order for this high-level message to be delivered, but the programmer can invoke it with just a few lines of code and be happily oblivious to all the underlying details.

RkJQdWJsaXNoZXIy MTM4ODY=