Skip to content

Can we use an empty (zero-length) hostname in the JP's link format? #87

@EskoDijk

Description

@EskoDijk

This discussion issue tries to achieve the same goal as #85 , but would be much less specification effort and is shorter.

The goal is to reduce complexity on the JP side in creating the Link Format document that is returned for JP discovery to the Pledge. Also, to reduce the size of the returned Link Format by removing unused elements.

The proposal is as follows: use a zero-length hostname in the URI of the CoRE LF link, instead of an IPv6 literal address. Per RFC 3986, a URI with zero-length hostname is a valid URI. Since the Pledge receiving the link is anyway not using the hostname, this works well for the Pledge and also guards well against any non-Pledge device that accidentally tries to follow/resolve the given link.

First the original example in the draft:

REQ: GET coap://[ff02::fd]/.well-known/core?rt=brski.jp

  RES: 2.05 Content
    Content-Format: 40 (application/link-format)
    Payload:
      <coaps://[fe80::c78:e3c4:58a0:a4ad]:8485>;rt=brski.jp

Second, the version using zero-length hostname:

REQ: GET coap://[ff02::fd]/.well-known/core?rt=brski.jp

  RES: 2.05 Content
    Content-Format: 40 (application/link-format)
    Payload:
      <//:8485>;rt=brski.jp

The ABNF that's being used (RFC 6690/3986):

   link-value     = "<" URI-Reference ">" *( ";" link-param )      
   URI-reference = URI / relative-ref                              
   relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
   relative-part = "//" authority path-abempty
   authority     = [ userinfo "@" ] host [ ":" port ]
   host          = IP-literal / IPv4address / reg-name
   reg-name      = *( unreserved / pct-encoded / sub-delims )

where reg-name has 0 characters, and path-abempty is empty.

Note that there's a semantic mismatch in the returned link: formally the link expresses "coap" protocol on port 8485 of a host with name "" (zero characters), which is semantically not an existing/correct host.

But the Pledge does get the port number easily extracted from the link and that was the goal.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions