------------------------------------------------------------------------- Mohamed G. Gouda CS 356 Spring 2017 Exercise 2 ------------------------------------------------------------------------- Consider two client-server applications that are running on top of the UDP Transport Layer. The first application consists of one server s1 (that is hosted in host sh1) and one client c (that is hosted in host ch). The second application consists of one server s2 (that is hosted in sh2) and client c (that is hosted in ch). (a) How many ports are allocated in these two applications? (b) How many sockets are allocated in these two applications? ------------------------------------------------------------------------- Solution: ------------------------------------------------------------------------- (a) These two applications allocate 4 ports: s1 allocates 1 well-known low-numbered port i1, s2 allocates 1 well-known low-numbered port i2, and c allocates 2 arbitrary high-numbered ports j1 and j2. (b) These two applications allocate 4 sockets: one socket is bound to each of the 4 ports allocated by the applications.