3i Infotech Papers: Sample Questions 827 - 828 of 1245

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 827

» Languages » C & C Plus Plus

Short Answer Question▾

Write in Short

What is alloca ()

Explanation

  • It allocates and frees memory after use or after getting out of scope.

  • As an example of the use of alloca, here is a function that opens a file name made from concatenating two argument strings, and returns a file descriptor or minus one signifying failure:

  1. int open2 (char *str1char *str2int flagsint mode)
  2. {
  3.     char *name = (char *) alloca (strlen (str1) + strlen (str2) + 1);
  4.     stpcpy (stpcpy (namestr1), str2);
  5.     return open (nameflagsmode);
  6. }

Question number: 828

» Basic CS » Networks

Essay Question▾

Describe in Detail

What is Proxy ARP?

Explanation

Define Proxy ARP.

Define Proxy ARP.

Define Proxy ARP.

  • Proxy ARP allows a device on a network to answer ARP queries for an IP address not on the network.

  • For example, using a router to answer ARP request.

  • Used when the originating host believes that a destination is local, when in fact it is lies beyond the router.

  • Allows machines on a subnet to reach remote subnets without need to configure routing or a default gateway.

Advantages:

  • It can be added to a single router on a network without disturbing routing tables of other routers on the network.

  • Used on the network where IP hosts are not configured with a default gateway or have no routing intelligence.

Disadvantages:

  • Increases amount of ARP traffic on segment.

  • Hosts need larger ARP tables to handle IP to MAC address mappings.

  • Does not work for networks that do not use ARP for address resolution.

  • Is not generalizable to all network topologies. For example, more than one router connecting two physical networks.

Use of proxy ARP:

  • Joins a broadcast LAN with serial links

  • Takes multiple addresses from a LAN

  • On a firewall

  • Mobile-IP

  • Transparent subnet gatewaying.