def get_mac_addr_from_datapath(datapath):
  """
  Return the MAC address from the datapath ID.
  
  According to OpenFlow switch specification, the lower 48 bits of the datapath
  ID contains the MAC address.
  """
  
  mac_addr_int = datapath.id & 0x0000ffffffffffff
  mac_addr = format(mac_addr_int, '02x')
  
  return ':'.join(mac_addr[i:i+2] for i in range(0, 12, 2))