1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Announcing DNS name on uPnP (for webif)

Discussion in 'HD/HDR-FOX T2 Customised Firmware' started by wilf, May 13, 2012.

  1. wilf

    wilf New Member

    Hi all,

    I couldn't find this covered anywhere, so I thought I'd post on here.

    The HDR fox announces it's NetBios name for file shares etc. and is visible in DLNA (such uses uPnP )
    What would be great is the box would register a domain name on uPnP (router permitting) .

    E.g.
    Http:// humax.interface

    The idea being to give a more user friendly, static (on dhcp, the up address can change) access point for the webif.

    I'm not that familiar with what uPnP can do, but does this sound a plausible feature? And might a package be plausible to add it to the custom firmware?

    Wilf


    p.s.
    The 3view box seems to announce DNS name, which my router presents as [name].config, though that wasn't the case for all user's routers.
     
  2. Andrew Benham

    Andrew Benham Member

    Does your DHCP server send a domain name to clients ?
    Having asked that, I ought to check whether the Humax dhcp client asks for the domain name option.

    Anyway, upshot is this should be set via DHCP, not uPnP.
     
  3. wilf

    wilf New Member

    Thanks.

    I'm only familiar with DHCP for assigning IP addresses.

    Will a DHCP hostname work in a web browser?
    I.e as far as I'm aware a browser uses DNS, so I guess I'm asking; will a successful DHCP hostage registration register a DNS enter on my router?

    If so, anyone know whether the Humax is supposed to be doing this?

    P.s. my router does have a self generated DNS entry for the humax consisting of :
    "unknown.[Mac address].config"

    Which means I have a static DNS entry which does what I'm after for now.
     
  4. af123

    af123 Administrator Staff Member

    The 3view box must be using some zeroconf service (either mDNS or SSDP). Something like that could be added to the Humax fairly easily.
     
  5. af123

    af123 Administrator Staff Member

    Give the new zeroconf package a try.. it should create a humax.local name which can be seen by anything running mDNS - works fine from my Macbook anyway.
     
  6. Andrew Benham

    Andrew Benham Member

    I've just wiresharked the Humax's ethernet port on startup, its DHCP request is asking for:
    IP address; Subnet Mask; Broadcast Address; Time Offset; Router; Domain Name; Domain Name Server; Domain Search; Host Name; NetBIOS server name; NetBIOS server scope; MTU; Static Routes; NTP Server; Private/Proxy autodiscovery

    That list is pretty typical of a request. The DHCP server in the average ADSL router will respond with IP address; Subnet Mask; Broadcast Address; Router; Domain Name Server and nothing else. You might be able to add options to the router's DHCP server (e.g. DGTeam firmware for Netgears), or you can run a DHCP server (ISC DHCP is good) on another machine on the LAN.
     
  7. wilf

    wilf New Member

    Hi both,

    Thanks af123, that sound spot on. I've installed, but I'm guessing a reboot will be needed as my Android browser isn't picking up the advice on humax.local yet. I'll reboot when there's no recording in the way.

    I'll have a look at my router options at some point Andrew, it's a reasonably wide-spread, rebadged Thompson from be.

    Thanks for the help.
     
  8. niclights

    niclights New Member

    Anyone else seeing high CPU with this installed?
     
  9. Wallace

    Wallace Slightly Pickled

    I hadn't checked until you asked but CPU was running at 41% (system) with it installed but 37% without.

    HTH.
     
  10. niclights

    niclights New Member

    Normally I average around 4% system (assuming there's no decrypt going on).

    I noticed today there had been approx 40% constantly since turning on. Tried a reboot and updated to 1.4 with no change.
    Looking at a 1 day graph it was clear that this began immediately after installing zeroconf last night.
    Remove package/reboot = back to 4%. (Repeated to check - reinstall = 40%, remove = 4%).
     
  11. xyz321

    xyz321 Well-Known Member

    It looks like it might be in a select loop with a timeout of zero which causes it to return immediately.

    Code:
    [pid  3037] _newselect(6, [3 5], NULL, NULL, {0, 0} <unfinished ...>
    [pid  3036] <... rt_sigprocmask resumed> NULL, 16) = 0
    [pid  3037] <... _newselect resumed> )  = 1 (in [3], left {0, 0})
    [pid  3036] nanosleep({3600, 0},  <unfinished ...>
    [pid  3037] sendto(5, "\0\0\204\0\0\0\0\2\0\0\0\5\5_http\4_tcp\5local\0\0\f"...
    , 192, 0, {sa_family=AF_INET, sin_port=htons(5353), sin_addr=inet_addr("224.0.0
    .251")}, 16) = 192
    [pid  3037] _newselect(6, [3 5], NULL, NULL, {0, 0}) = 2 (in [3 5], left {0, 0}
    )
    [pid  3037] recvfrom(5, "\0\0\204\0\0\0\0\2\0\0\0\5\5_http\4_tcp\5local\0\0\f".
    .., 65536, 0, {sa_family=AF_INET, sin_port=htons(5353), sin_addr=inet_addr("192
    .168.1.251")}, [16]) = 192
    [pid  3037] _newselect(6, [3 5], NULL, NULL, {0, 0}) = 1 (in [3], left {0, 0})
    [pid  3037] _newselect(6, [3 5], NULL, NULL, {0, 0}) = 1 (in [3], left {0, 0})
    [pid  3037] _newselect(6, [3 5], NULL, NULL, {0, 0}) = 1 (in [3], left {0, 0})
    [pid  3037] _newselect(6, [3 5], NULL, NULL, {0, 0}) = 1 (in [3], left {0, 0})
      :
      :
      :
    
     
  12. af123

    af123 Administrator Staff Member

    Ok, needs some work... Thanks : )
     
  13. Ezra Pound

    Ezra Pound Well-Known Member

    You can keep track on each process by running top from a Telnet window, as you can see in this picture humaxtv is taking about 9%, top itself about 1% and everything else not much at all. CTRL-C to exit top.
    BTW
    I am not running zeroconf

    top.jpg
     
  14. af123

    af123 Administrator Staff Member

    Spot on - https://bitbucket.org/geekman/tinysvcmdns/src/3f9615e8d848/mdnsd.c

    I wonder why the implementor did that? The code properly joins the multicast group so it shouldn't expect to receive packets continuously.
     
  15. af123

    af123 Administrator Staff Member

    I've uploaded a new version of the zeroconf package which fixes the high CPU utilisation (now uses practically none as intended) and adds initial LLMNR support (see below)

    This package introduces a small daemon which implements both the Apple mDNS and Microsoft LLMNR protocols for zeroconf name resolution (see http://en.wikipedia.org/wiki/Zero_configuration_networking#Name_resolution)

    The first implementation is working properly in that I can successfully resolve the Humax from Linux and Apple hosts, e.g.:

    Code:
    root@raspberrypi:/home/pi# apt-get install libnss-mdns
    ...
    root@raspberrypi:/home/pi# ping humax.local
    PING humax.local (172.29.0.252) 56(84) bytes of data.
    64 bytes from humax.local (172.29.0.252): icmp_req=1 ttl=64 time=8.93 ms
    
    and

    Code:
    air(7) uname -a
    Darwin air 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64
    air(8) ping humax.local
    PING humax.local (172.29.0.252): 56 data bytes
    64 bytes from 172.29.0.252: icmp_seq=0 ttl=64 time=7.616 ms
    
    The LLMNR implementation doesn't seem to be working properly yet, although packet traces show that the right thing is occurring (next step is to read the RFC properly!).

    Code:
    No.    Time          Source                Destination          Protocol Length Info
        19 2.194065000    172.29.0.67          224.0.0.252          LLMNR    65    Standard query 0xedf8 A humax
     
    Frame 19: 65 bytes on wire (520 bits), 65 bytes captured (520 bits)
    Ethernet II, Src: Apple_24:99:42 (28:37:37:xx:xx:xx), Dst: IPv4mcast_00:00:fc (01:00:5e:00:00:fc)
    Internet Protocol Version 4, Src: 172.29.0.67 (172.29.0.67), Dst: 224.0.0.252 (224.0.0.252)
    User Datagram Protocol, Src Port: 61275 (61275), Dst Port: llmnr (5355)
    Link-local Multicast Name Resolution (query)
        Transaction ID: 0xedf8
        Flags: 0x0000 (Standard query)
        Questions: 1
        Answer RRs: 0
        Authority RRs: 0
        Additional RRs: 0
        Queries
            humax: type A, class IN
                Name: humax
                Type: A (Host address)
                Class: IN (0x0001)
     
    No.    Time          Source                Destination          Protocol Length Info
        20 2.200731000    172.29.0.252          172.29.0.67          LLMNR    75    Standard query response 0xedf8 A 172.29.0.252
     
    Frame 20: 75 bytes on wire (600 bits), 75 bytes captured (600 bits)
    Ethernet II, Src: Humax_bb:93:c3 (00:03:78:xx:xx:xx), Dst: Apple_24:99:42 (28:37:37:xx:xx:xx)
    Internet Protocol Version 4, Src: 172.29.0.252 (172.29.0.252), Dst: 172.29.0.67 (172.29.0.67)
    User Datagram Protocol, Src Port: llmnr (5355), Dst Port: 61275 (61275)
    Link-local Multicast Name Resolution (response)
        Transaction ID: 0xedf8
        Flags: 0x8400 (Standard query response, No error)
        Questions: 0
        Answer RRs: 1
        Authority RRs: 0
        Additional RRs: 0
        Answers
            humax: type A, class IN, addr 172.29.0.252
                Name: humax
                Type: A (Host address)
                Class: IN (0x0001)
                Time to live: 2 minutes
                Data length: 4
                Addr: 172.29.0.252 (172.29.0.252)
    
     
    Drutt likes this.
  16. Andrew Benham

    Andrew Benham Member

    I just dug out my BeBox TG585v7! I'm on BE, but don't use their box. Anyway, the commands needed are under
    dhcp server options
    but it all looks rather gory. I suspect it's too much hassle for the average user.
    http://www.neologue.co.uk/mwuki?title=Thomson+Speedtouch+telnet+interface
     
  17. Black Hole

    Black Hole Felonius Gru

    If I install this then, I can just browse or Telnet or FTP "Humax.local"? What happens with two Humii on the network?
     
  18. af123

    af123 Administrator Staff Member

    You can if the client you're using supports MDNS. Windows computers which have iTunes installed and library sharing enabled support MDNS, as do Linux boxes with the right NSS plugin and Apple devices by default.

    The package advertises whatever hostname you've set for the Humax followed by the .local, so humax.local by default but you may well have set the second to humaxbedroom.local
     
  19. Black Hole

    Black Hole Felonius Gru

    zeroconf was working fine yesterday (iPad/Safari), today I have to go back to the IP addresses. Any clues why?