Presentation is loading. Please wait.

Presentation is loading. Please wait.

INTERNET TECHNOLOGIES

Similar presentations


Presentation on theme: "INTERNET TECHNOLOGIES"— Presentation transcript:

1 INTERNET TECHNOLOGIES
Week 11 Application Layer Paradigm

2 Application Layer Provides services to the user
Communication provided using a logical connection Two application layers assume that there is an imaginary direct connection through which they can send and receive messages.

3 Logical connection at application layer

4 Providing Services Most communication networks were originally designed to provide one specific service Eg phone network originally designed to provide voice service - allow people all over world to talk to each other Later used for other services Fax - enabled by adding extra hardware at both ends.

5 Providing Services Internet also provides services to users around world TCP/IP layers allow more flexibility Protocols can be added and removed Need to ensure that upper and lower layers can cope with these changes Application layer at top Easier to add new protocols Initially only a few protocols used Now there are too many to count (and growing).

6 Application Layer Protocols
Standard Application Layer Protocols Defined by Internet Authorities FTP, Telnet, HTTP Non Standard Application Layer Protocols New protocols (proprietary) can be created Don’t need approval to use privately Must interact with lower layers correctly.

7 Application Layer Paradigms
To use Internet, need two application programs to interact with each other: One running on a computer somewhere in world Another running on computer somewhere else Need to send messages to each other through Internet infrastructure Two paradigms have been developed Client-server paradigm Peer-to-peer paradigm (discussed last week).

8 Figure 25.2: Example of a client-server paradigm

9 Figure 25.3: Example of a peer-to-peer paradigm

10 Client-Server Programming
Communication at application layer between two running application programs (processes) Client Running program initialises communication by sending request Server Another application program that waits for request from client.

11 Application Programming Interface
Programs normally written in languages with predefined sets of instructions Process to be able to communicate with another process Need set of instructions to tell lowest four layers of TCP/IP suite to: Open connection Send and receive data from other end Close connection This instruction called: Application Programming Interface (API).

12 Application Programming Interface
Many communications APIs exist: Transport Layer Interface (TLI) STREAM Sockets Interface (more common).

13 Figure 25.4: Socket interface

14 Sockets used like other sources & sinks
Started in early 1980s as part of Unix Applications send/receive data to/from sockets (similar to write/read to terminal or file).

15 Figure 25.6: Use of sockets in process-to-process communication
As far as Application layer is concerned: Communications between client process and server process is via two sockets Transfer of information between sockets is handles by Operating System and TCP/IP protocols

16 Figure 25.7: A socket address
Socket addresses (2) required for communications Need IP address Finds host Need Port number Finds application on host

17 Using Transport Layer Pair of Application processes provide services to users - humans or programs Need to use services provided by transport layer for communications 3 common transport layer protocols in TCP/IP suite: UDP - User Datagram Protocol TCP - Transmission Control Protocol SCTP - Stream Control Transmission Protocol Most standard applications use services of one.

18 Iterative Using UDP An iterative server processes one client request at a time Receives a request, processes it, and sends response to requestor before handling another request When server handles request from client, requests from other clients (even same client) need to be queued at the server site and wait for server to be ready Received and queued requests are handled in first-in, first-out (FIFO) fashion Server socket created and remains available Client socket created and destroyed for each interaction.

19 Figure 25.8: Sockets for UDP communication

20 Iterative Using TCP Iterative communication using TCP is not common
Relatively simple type of communication TCP Connection oriented Uses two different sockets Connection establishment Data transfer.

21 Figure 25.10: Sockets used in TCP communication

22 World Wide Web Idea of Web first proposed by Tim Berners-Lee in 1989 at CERN (European Organization for Nuclear Research - "Conseil Européen pour la Recherche Nucléaire") Allowed several researchers at different locations throughout Europe to access each others’ research Commercial Web started in early 1990s.

23 Example 26.1 Assume need to retrieve a scientific document that contains one reference to another text file and one reference to a large image The main document and the image are stored in two separate files in the same site (file A and file B) A referenced text file stored on another site (file C) Three different files, need three transactions to see whole document.

24 Figure 26.1: Example 26.1

25 Figure 26.2: Browser Web Browser usually has three main parts
Controller Client protocols Interpreters

26 URL Protocol http, https, ftp etc Host IP address or hostname
Eg or Port Port number (16 bit integer) 80 default for http 443 default for https etc Path Directory path of files on server.

27 URL Format of URL protocol://host:port/path
Only need :port number if not default Don’t need unless other protocol needed Often don’t need www (some cases mandatory).

28 HyperText Transfer Protocol
HyperText Transfer Protocol (HTTP) used to define how client-server programs can be written to retrieve web pages from Web HTTP client sends request HTTP server returns response Server uses port number 80 Client uses temporary port number HTTP uses services of TCP ie connection-oriented and reliable protocol.

29 Example 26.3 Nonpersistent connection
Need a TCP connection for each link (even on same server) Eg Client needs to access file that contains 1 link to image Text file and image located on same server Need two connections TCP requires at least three handshake messages to establish each connection Request sent with third one After connection established object transferred After receiving object Another three handshake messages needed to terminate connection.

30 Figure 26.3: Example 26.3

31 Example 26.4 Persistent connection
Only one connection establishment and connection termination is used Request for image sent separately.

32 Figure 26.4: Example 26.4

33 Figure 26.5: Formats of the request and response messages

34 Table 26.1: Methods

35 Table 26.2: Request Header Names

36 Table 26.3: Response Header Names

37 Example 26.5 Retrieve a document
Request - Use GET method to retrieve image /usr/bin/image1 Request line Shows method (GET), URL, HTTP version (1.1) Header 2 lines - client can accept images in GIF or JPEG format Request does not have a body Response message - status line & four lines of header Header lines define date, server, content encoding (MIME version), length of document Body of document follows header.

38 Figure 26.6: Example 26.5

39 Example 26.6 Client wants to send a web page to be posted on server
Use PUT method Request line shows the method (PUT), URL, HTTP version Header has four lines. Request body contains web page to be posted Response message contains the status line and four header lines Created document (CGI document) included as body.

40 Figure 26.7: Example 26.6

41 Ftp File Transfer Protocol (FTP) - standard protocol provided by TCP/IP for copying files between hosts Although transferring files from one system to another seems simple and straightforward, some problems must be dealt with first.

42 Figure 26.10: FTP

43 Two Connections Two connections in FTP have different lifetimes
Control connection connected during entire interactive FTP session Data connection opened and closed for each file transfer activity Opens each time commands involve transferring files Closes when file transfer completed.

44 Control Connection FTP uses same approach as TELNET for control communications (uses port 21) Uses NVT (Network Virtual Terminal) ASCII character set (same as TELNET) Communication achieved through commands and responses Simple method adequate for control connections since one command (or response) sent at a time Each line terminated with a two-character (carriage return and line feed) end-of-line token.

45 Table 26.4: Some FTP commands

46 Table 26.4 : Some FTP commands (continued)

47 Table 26.5: Some responses in FTP

48 Data Connection Data connection uses well-known port 20 at server site
Creation of data connection different from control connection Client, not server, issues passive open using an ephemeral port Using PORT command, client sends this port number to server Server receives port number and issues active open using well-known port 20 and the received ephemeral port number.

49 Example 26.10 Using FTP for retrieving a file
One file to be transferred Control connection remains open all the time Data connection opened and closed repeatedly Assume file transferred in six sections After all records transferred, server control process announces file transfer completed. Client control process issues QUIT command Service connection then closed.

50 Figure 26.11: Example 26.12

51 Example 26.11 An actual FTP session that lists the directories

52 Security for FTP FTP protocol designed when security not a big issue
FTP usually requires password Sent in plaintext (unencrypted) Can be intercepted & used by an attacker Data transfer connection also transfers data in plaintext, also insecure Can add Secure Socket Layer between FTP application layer and the TCP layer Then FTP is called SSL-FTP (or SFTP).

53 Domain Name System (DNS)
Designed to help other application programs Internet needs directory system to map name to address Analogous to directories in telephone network.

54 Figure 26.28: Purpose of DNS

55 Name Space To be unambiguous, names assigned to machines must be carefully selected from a name space with complete control over the binding between the names and IP addresses ie names must be unique since addresses are unique A name space that maps each address to a unique name can be organised in two ways Flat Hierarchical.

56 Figure 26.29: Domain name space

57 Fig 26.30: Domain names and labels

58 Figure 26.31: Domains

59 Fig 26.32: Hierarchy of name servers

60 Figure 26.33: Zone

61 DNS in the Internet DNS protocol can be used on different platforms
Internet - domain name space (tree) originally divided into three different sections: Generic domains Country domains Inverse domains Due to rapid growth of Internet, extremely difficult to keep track of inverse domains, which could be used to find the name of a host when given the IP address Inverse domains now deprecated (see RFC3425).

62 Figure 26.34: Generic domains

63 Table 26.12: Generic domain labels

64 Figure 26.35: Country domains

65 Resolution Mapping name to IP address - name-address resolution
DNS - client-server application If host needs to map address to name OR name to address - call DNS client - resolver Resolver accesses closest DNS server If server has information Info sent to resolver Else Refers resolver to other servers OR asks other servers to provide information.

66 Figure 26.36: Recursive resolution

67 Figure 26.37: Iterative resolution

68 Caching Each time a server receives query for name not in its domain
Searches its database for server IP address Reduction of this search time would increase efficiency DNS handles this with a mechanism called caching Common sites remain in cache for faster search.

69 Resource Records Zone information associated with server implemented as set of resource records ie name server stores database of resource records Resource record a 5-tuple structure:

70 Table 26.13: DNS types

71 DNS Messages To retrieve information about hosts, DNS uses two types of messages Query Response Both have same format.

72 Figure 26.38: DNS message

73 Example 26.13 In Unix/Linux/Mac and Windows
nslookup utility used to retrieve address/name Retrieve address when domain name given: $ nslookup Name: Address:

74 Registrars How are new domains added to DNS? Through Registrar
Commercial entity accredited by ICANN Verifies requested domain name unique Then enters in DNS database.

75 DDNS When DNS designed, many address changes were not expected
Eg adding new host, removing host, changing IP address - change must be made to DNS master file Manual updating To difficult with current size of Internet Dynamic Domain Name System (DDNS) DHCP used to send new info to primary DNS Secondary DNS informed of change Actively – info pushed to secondary Passively – wait for secondary query.

76 Security of DNS DNS important in Internet infrastructure
Provides crucial services to Internet users Applications such as Web access or heavily dependent on proper operation of DNS DNSSEC (DNS Security) used to authenticate and check integrity of DNS messages Slowly being deployed throughout Needs tools on Clients and Servers.

77 DNS Attacks Typo squatting
Registering domain names similar to existing brands Distributed Denial of Service attacks (DDoS) Particularly vulnerable - a logical choke point on the network DNS Amplification Attacks DDoS attack for DNS with insecure "recursive" configurations Registrar Hijacking Identity theft, gaining control over a domain name Cache poisoning Bad data passed to DNS resolver's cache

78 End


Download ppt "INTERNET TECHNOLOGIES"

Similar presentations


Ads by Google