What is an IP Address: A numeric label assigned to every device that uses the internet to communicate. IP stands for Internet Protocol. IP addresses are the identifiers that allow data to be sent over the internet.
A set of 4 8-bit numbers seperated by periods. Each number is in the range 0-255. Exceptions are 0.0.0.0 and 255.255.255.255
IP Addresses allow us to send information in three main ways.
Popcorn Hack - Finding your IP
- https://www.whatsmyip.org/ works for both mac and windows
- Alternatively, you can open up a command prompt (cmd into search bar), and type ipconfig
A TCP/IP Protocol is a set of rules that governs something within computer communication. The IETF, or Internet Engineering Task Force, manages these rules and facilitates the open development of them.
Example: ASCII Protocol
- ASCII (American Standard Code for Information Interchange) is a internet protocol that you may be familiar with, is a type of character encoding
- ASCII is a protocol governing how text is represented as binary
- 128 characters, 95 printable
There are many more protocols, each governing a specific area of how computer communicate. Ex. ARP, DNS, FTP, UDP, PPP, SAP
We obviously can’t cover every protocol, but we’ll be talking about a few important ones today.
The OSI model, also known as the Open Systems Interconnection Model, helps represent communications between two computers.
Layer | Name | Function | Example |
---|---|---|---|
1 | Physical | Transport of data between tangible, physical things | DSL |
2 | Data Link | Device identification and forwarding on a LOCAL network (i.e. home, school) | PPP |
3 | Network | Manages identification and path that a device should take, very few of these protocols | STP |
4 | Transport | Manages transport of data between computers (delivery method, i.e. fast vs slow) | UDP |
5 | Session | Manages connectivity between devices | SAP |
6 | Presentation | Translates from data sent between computers (binary) to something humans can understand | TLS |
7 | Application | User Interaction, like resource sharing | HTTP |
Popcorn Hack
- We just gave an example of a protocol, ASCII, above. What OSI Layer does ASCII fall into?
- Give another example of a protocol from that layer
Popcorn Hack
- Open up a command prompt and type “nslookup google.com”
- You should get 142.250.68.78, we mainly care about the bottom address for now
- Try visiting that website in your search bar!
Popcorn Hack
- List 4 more websites you use often and their IPs
- What’s a subdomain of your passion project backend from last time?
- What’s the domain of your current binary CPT project?
HTTP (Hypertext Transfer Protocol) and HTTPS (Hypertext Transfer Protocol Secure) are both protocols used for transferring data over the web. The key difference lies in the security aspect.
HTTP is the standard protocol for transmitting data over the internet. However, it does not provide any encryption, making it susceptible to eavesdropping and unauthorized access. This means that any information exchanged between the user’s browser and the website, such as login credentials or personal data, is sent in plain text.
On the other hand, HTTPS adds a layer of security by incorporating SSL/TLS (Secure Sockets Layer/Transport Layer Security) encryption. This encryption ensures that the data exchanged between the user and the website is encrypted, making it much more challenging for malicious actors to intercept or tamper with the information.
We SSL based encryption last trimester with certbot. Certbot generated SSL certificates for us to ensure HTTPS connection between the client and your website.
TCP and UDP are both Transport protocols (layer 4 of OSI and layer 3 of TCP/IP). This means they are a set of rules that specify how data is exchanged between devices over the Internet.
What’s in a TCP packet? Packets are a unit of information that are sent over the network. They contain user data, among other identification information.
The TCP handshake process - this is how a TCP session is initiated.
Step 1: Client A requests a client-to-server communication session with Server B (SYN)
Step 2: Server B acknowledges client-to-server communication session, requests server-to-client communication session (SYN-ACK)
Step 3: Client A acknowledges server-to-client communication session (ACK)
After these steps are executed in order, the communication pathway is established between Client A and Server B.
How does TCP actually send the data?
TCP Session Termination
Enough about TCP… what about UDP?
UDP Pros:
UDP Cons:
UDP sends out all packets at once without any form of handshake or acknowledgement.
Popcorn Hack
- When do we use UDP? While it seems terrible, try to think of some use cases!
- When might we use TCP?
Please answer all of these questions on your personal blog and explain. Don’t just give an answer. Homework is due Sunday night at 6 pm