7
Application-layer protocols (cont). API: application programming interface zdefines interface between application and transport layers zsocket: Internet API ytwo processes communicate by sending data into socket, reading data out of socket Q: how does a process “identify” the other process with which it wants to communicate? yIP address of host running other process y“port number” - allows receiving host to determine to which local process the message should be delivered

17
DNS name servers zno server has all name-to- IP address mappings local name servers: yeach ISP, company has local (default) name server yhost DNS query first goes to local name server authoritative name server: yfor a host: stores that host’s IP address, name ycan perform name/address translation for that host’s name Why not centralize DNS? z single point of failure z traffic volume z distant centralized database z maintenance doesn’t scale!

23
DNS resource records DNS: distributed db storing resource records (RR) z Type=NS  name is domain (e.g. foo.com)  value is IP address of authoritative name server for this domain RR format: (name, value, type,ttl) zType=A  name is hostname  value is IP address zType=CNAME  name is alias name for some “cannonical” (the real) name www.ibm.com is really servereast.backup2.ibm.com  value is cannonical name zType=MX  value is name of mailserver associated with name

36
http response status codes 200 OK yrequest succeeded, requested object later in this message 301 Moved Permanently yrequested object moved, new location specified later in this message (Location:) 400 Bad Request yrequest message not understood by server 404 Not Found yrequested document not found on this server 505 HTTP Version Not Supported In first line in server->client response message. A few sample codes: