Introduction to Networking Part 2
By: Mushr00m
Note: After my basic networking tutorials (May be around 15-20 of them) are written I will move onto network security, and how to use this knowledge to test network vulnerability
The Application Layer
How the web works.
-Web clients (Browsers) make HTTP requests to web servers.
-Web servers answer with HTTP responses.
-This process is initiated every time you visit a website. This process always starts a request-response cycle.
-There can be many steps to the request-response cycle. This is due to the fact that websites contain graphics, embedded files, etc...These each require separate reponses.
Simple HTTP diagram
(Source: http://dev.fyicenter.com/faq/xhtml/http_diagram.jpg)
Spoiler (Click to View)
The 3 Parts of an HTTP Request
1. Request Line (Required)
Starts with a command and URL and ends with an HTTP version number.
2. Request Header (Optional)
Contains information on the browser, date, and the referring page from which the request originated. If the user types in the URL by themselves, then the referring page is blank.
2. Request Body (Optional)
Contains information sent to the server, such as a form.
The 3 Parts of an HTTP Response
1. Response Status (Optional)
Shows the HTTP version number, the status code (Ex. 200=ok and 404=page not found), and the reason phrase. The reason phrase is a description of the status code.
2. Response Header (Optional)
Contains information on the server, date, exact URL of the retrieved page, and the format used for the body of the response (Ex. HTML).
1. Response Body (Required)
Contains the requested web page.
Fun with your command prompt-Turn it into a browser
Note: HTTP uses Port 80
1. Open up your command prompt.
2. Type: telnet www.google.com 80
3. (Send HTTP request manually) GET http://www.google.com/index.html HTTP/1.0
4. Press enter twice
Application Architectures
-Server-based
-Client-based
-Client-Server Architectures
-Choosing Architectures
-Middleware
Application programs are made up of four functions:
1. Data Storage
2. Data Access Logic
3. Application Logic
4. Presentation Logic
These four functions can be split between clients and servers. How they are split is based upon the application architectures.
3-Tier Architecture
[img]http://elearn.main.nvsu.edu.ph/ebooks/java.unleashed.2nd/f25-3.gif[/img]
(Image Source: http://elearn.main.nvsu.edu.ph/ebooks/ja.../f25-3.gif)
N Tier Architecture
[img]http://www.developer.com/img/2009/03/SpringPat04.JPG[/img]
(Image Source: http://www.developer.com/img/2009/03/SpringPat04.JPG)
E-Mail
-Asynchronous communication method
The most used application on the internet due to its advantages:
-Much faster than regular mail
-Extremely inexpensive
-Can substitute as other forms of communication (Ex. phone calls)
E-Mail Standards
Simple Mail Transfer Protocol (SMTP)-Used for sending e-mail.
Post Office Protocol (POP)-Moves/Copies all e-mails to a local machine.
Internet Mail Access Protocol (IMAP)-Allows you to access e-mails online.
SMTP is the main e-mail standard for transfer agents in use today. However, the downside of SMTP is that it was only written to handle text files.
Basic diagram of e-mail using SMTP and POP
[img]http://14theories.com/images/smtp_pop3_diagram.jpg[/img]
Two-Tier E-Mail Architecture
Consists of:
User Agents
Also called an e-mail client, a user agent is a program that runs on a clients computer that sends e-mails to e-mail servers and downloads e-mails from mailboxes on those servers. Ex. Outlook, Eudora, etc...
Mail Transfer Agents
E-mail server software that sends e-mails between e-mail servers and maintains individual mailboxes.
Three-Tier E-Mail Architecture
When you browse through your e-mails online, you are accessing your e-mails using a 3 tier e-mail architecture. Ex. Hotmail, Yahoo, Gmail, etc...
The three tiers are:
1. The Web Browser that sends the HTTP request to the web server.
2. The Web Server sends an HTTP response. The HTTP response is forwarded to the web client. The web client translates the HTTP requests into an SMTP packet. The SMTP packet is then sent to the mail server.
3. The Mail Server in a 3 tier architecture performs the same way as it does in a 2 tier architecture.
Multipurpose Internet Mail Extensions
-Because SMTP was developed for transferring text files, special techniques needed to be developed to send binary files.
-Included as part of an e-mail client, MIME translates attached binary file into text allowing the file to be sent as part of an SMTP message.
-The receiver’s e-mail client then translates the MIME attachment from text back into binary format.
Using your Command Prompt as an e-mail client
Code
telnet mail.domain.ext 25
HELO local.domain.name
MAIL FROM: [email protected]
RCPT TO: [email protected]
DATA
Subject: -type subject here-
[body of your message]
.
QUITVideo Conferencing and VoIP Protocols
-H.323
-IP Multimedia Subsystem (IMS)
-Media Gateway Control Protocol (MGCP)
-Session Initiation Protocol (SIP)
-Real-time Transport Protocol (RTP)
-MPEG-2 or MPEG-4 for video/audio codec (compression/decompression).
NOTE: THIS TUTORIAL MAY BE REPRODUCED FREELY OVER THE INTERNET.


