Vous êtes sur la page 1sur 7

TjWallas Tech Docs

HTTP://TJWALLAS.WEEBLY.COM

1. Which meaning do the port numbers have in TCP and UDP? The port numbers in TCP and UDP packets act as identifiers to the current running applications/Processes in the application layer (Above transport layer) which are sending those packets over the network. Briefly, Hosts use applications or processes that allow them to communicate with each other through the network and in one way or another these applications or softwares manage these packets in the application layer (Interface, data/file assembly, etc.). Each application is associated with a certain socket at both sides: the sender side and the receiver side. This socket itself has a unique port number so, the corresponding hosts can identify to which specific corresponding application(s) these packet are intended. There are some well-known and reserved ports for specific applications. For example, web browsers usually use port 80 for their http connections. Basically after the packet is passed from the application layer to the transport layer <TCP, UDP> the source and the destination port numbers are added in the header of each packet being transmitted.

2. What is NAT? explain briey. NAT is the Network Address Translation protocol. These techniques basically allows modification of the packets being sent over the Network by editing source and destination IP fields in these packets and even modify the source and destination port numbers of those packets. In other words, Network addresses can be translated from one address to another via NAT. Simply routers can keep mapping tables of network addresses and their corresponding translations. There are many forms of NAT and it is one of the most vital techniques right now. One application of NAT is that it helped saving the internet public IPs in IPv4 from running out. For instance, in a private network (LAN), many hosts would want to connect to the internet using the same gateway <Router> instead of given each host a public internet IP. The whole network is given one public IP and these hosts appear online with that same public IP at the same time. Simply on incoming / Outgoing traffic the network addresses are translated right away by the router. (Incoming: From WAN IP <public internet IP>to LAN IP <Specific host IP in the private network> and vice versa in case of outgoing).

All Copyrights reserved to TjWallas

Page 1

TjWallas Tech Docs

HTTP://TJWALLAS.WEEBLY.COM

3. How does the le transfer in FTP take place? While doing that which problems can appear in FTP and NAT? In FTP (File Transfer Protocol) the following steps take place in order to transfer a file: 1. A Control connection is initiated on TCP port 21 between the client and the server. This connection is basically responsible for authorization, Control commands <Messages> and enforcing Integrity and security over the whole process. 2. A Data Connection is initiated on port 20 between the client and the server. This connection or session is responsible of any data being transmitted from the server to the client. 3. If the client was authorized correctly <Have access to these files/locations> during step 1 and his connection was accepted by the server Go to step 4. Else Connection Refused by server. 4. The client starts sending requests for downloading files/listing directories to the server and the server in return responds by sending the requested data/Files to the clients if the client is authorized correctly via the Control connection. 5. In step 2, on data connection initiation, There are two modes of operation for the FTP Connection: either Active mode <PORT> or passive mode <PASV>. In active mode the client sends the server the IP address and port number that he will use for the FTP Data connection and then the server opens that connection. While in passive mode, Its the opposite: The Server forwards these details to the client and the client Opens that connection. During the above steps in case of FTP using NAT the following problems/scenarios might occur: Data connections may be sent to random port numbers. Data connections may originate from the server to the client, as well as originating from the client to the server. Data connections destination addresses are negotiated on the fly between the client and server over the channel used for the control connection.

Therefore the NAT devices must somehow parse the commands sent via FTP connection and do the Network Translation Accordingly as these new addresses <In case of diff file storage servers, .. etc)> and port numbers negotiated between the client and the server via FTP differ from their original source and destination Addresses and port numbers.

All Copyrights reserved to TjWallas

Page 2

TjWallas Tech Docs

HTTP://TJWALLAS.WEEBLY.COM

Fig.1 Showing FTP in case of active FTP data connection (Source: http://docstore.mik.ua/orelly/networking_2ndEd/fire/figs/fire2.1701.gif )

Fig.2 Showing FTP in case of passive FTP data connection (Source: http://docstore.mik.ua/orelly/networking_2ndEd/fire/figs/fire2.1702.gif ) All Copyrights reserved to TjWallas Page 3

TjWallas Tech Docs

HTTP://TJWALLAS.WEEBLY.COM

4. Which functionality does HTTP oer? How does the web server notify the client about the type of the data transmitted? HTTP (Hyper Text Transfer Protocol) basically offers Request-Response based connection between clients and servers and is used to transfer hypertext files such as webpages <HTML files> along with their attached images and resources between the server side and the client side. The HTTP protocol is an application layer protocol and runs usually over TCP port 80 in the Transport layer. HTTP Web pages and attached content are usually identified by their URI <Unique Reference Identifier> which is used in both processes: requests and responses. Where the http content is fetched and sent over the network referring to its URI. The web server notifies the client about the type of data being transmitted by setting the content-Type field in the header of the http packets. In this way when the client sees the servers response <HTTP response packets> he can directly know what type of data to expect and accordingly enable/disable different data representations and handling algorithms. Examples of Content types: text/html, image/png, ... etc) Here is a snapshot of an HTTP message (Source: http://www.xml.com/2006/09/27/graphics/LiveHTTPHeadersResponse.png

All Copyrights reserved to TjWallas

Page 4

TjWallas Tech Docs

HTTP://TJWALLAS.WEEBLY.COM

5. What information is contained in a URL and/or a URI? (Source: http://www.bernzilla.com/item.php?id=100 )

(Source: http://en.wikipedia.org/wiki/File:URI_Venn_Diagram.svg ) As shown in the above figure a URL (Uniform Resource Locator) is a subset of the URI (Uniform Resource Identifier). Basically, the URI is a String representation of the exact location/route to a certain file, document , etc) in a network , this URI indicates the mechanism for retrieving it , its exact file name , and the server path its in. The URI has to be UNIQUE for every single resource or file. However, The URL is only that portion of the URL that contains the retrieval mechanism <HTTP, FTP, HTTPS, mailto: , etc) > and the route to the server and/or page containing that file. The URN (Uniform Resource Name) turn comes then, which specifies the exact name of that file. Multiple resources can have the same URL but differ in URN and vice versa. For example lets consider the URI source of the above fig. : http://en.wikipedia.org/wiki/File:URI_Venn_Diagram.svg . The whole String is the URI. The URL of that URI would be the substring http://en.wikipedia.org/wiki/ and the URN would be the remaining substring Venn_Diagram.svg.

6. How does a web page with dierent data types delivered to the client side. Does this happen in one stream? The client requests the so called base file (HTML file) of the webpage first. Then the client application reading that page aka web browser discovers that there are some missing files with different data types are associated with that webpage or required for that webpage to display properly <Noted easily from the HTML tags and URIs specified in the HTML doc>. Then the client requests these resources / Files from the server again. Which in return, sends these files to the client via HTTP connection over TCP. This usually does not happen in one data stream such that different files are sent in different streams using either persistent or non-persistent http connections over TCP. However in case of pipelined HTTP connection it might give the illusion that multiple files are being sent in one stream. In fact, they are being sent sequentially in different streams.

All Copyrights reserved to TjWallas

Page 5

TjWallas Tech Docs

HTTP://TJWALLAS.WEEBLY.COM

7. What do you know about the SMTP-after-POP procedure? Which Disadvantage of SMTPProtocols is dealt with here? The SMTP-after-POP procedure is a way of authorization which can be used by the SMTP (Simple Mail Transfer Protocol). Simply a user, is allowed to send mail via SMTP and is correctly authorized if and only if that user can <Is allowed to> download his Emails to the same location (Host Network address) he wants to send a message from. This insures that the user is correctly authenticated using the POP service for downloading Emails using the mail client software. The disadvantages of this procedure are : The client has to download his Emails (and authorize correctly using POP) to his PC each and every time he wants to send an Email using SMTP. The server has to correctly use some sort of a complex communication channel or tunnel between the POP and SMTP. Case of users having Dynamic IP addresses. POP sessions may expire too early or too late and therefore the client may experience sending failures via SMTP.

8. How can one get a mail while his own address is not listed in the to-eld? Why these mails are nevertheless delivered? Because in the Email format <Message header> actually the To field is not necessarily related to the addresses to which the message is delivered. The actual delivery list is defined explicitly and independently in the SMTP protocol or service on the server, which may or may not contain the addresses specified in the header of the Email <Specifically the To field>. These Emails are nevertheless delivered because they might have been statically or manually configured in the SMTP service on that Mail Server. So, whatever happens these rules or Email routes will be applied.

All Copyrights reserved to TjWallas

Page 6

TjWallas Tech Docs

HTTP://TJWALLAS.WEEBLY.COM

9. How is it technically possible to host more than one domain on a web server (with one IP address)? Well, the process is quite simple because all whats necessary is configuring that webserver to serve or respond to these domains according to the domain name or URL of each one. But in that case, both domains will be sharing the same resources of that server. And the DNS service should take care of the rest =). In case of DNS requests for any of the domains The server will send the DNS response with its IP. And the internally manage the route to which domain according to the http request message received from the client. For example two domains with names: moataz.me and amr.me can be hosted on one server. The server got two main directories, one for each. On connection request to moataz.me the dns service maps to the IP of the one and only server and the server redirects to the homepage in the moataz directory because it examined the domain name / URI to that HTTP request and same in case of amr.me.

All Copyrights reserved to TjWallas

Page 7

Vous aimerez peut-être aussi