Introduction to NFC

21
Introduction to NFC Wei-Tsung Su ( 蘇蘇蘇 ) [email protected] 05/28/2014 (Ver. 1.0) Page : 1 Ubiquitous Computing and Ambient Networking Laboratory

description

An introduction to NFC and NFC Data Exchange Format (NDEF)

Transcript of Introduction to NFC

Page 1: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

Introduction to NFC

Wei-Tsung Su (蘇維宗 )

[email protected]

05/28/2014 (Ver. 1.0)

Page : 1

Page 2: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

Change LogDate Ver. Authors Description

5/28/2014 1.0 Wei-Tsung Su Introduction to NFC; NFC Data Exchange Format

Page : 2

Page 3: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

Reference

• NFC Data Exchange Format (NDEF) Technical Specification 1.0

• NFC Record Type Definition (RTD) Technical Specification 1.0

• Text Record Type Definition 1.0• URI Record Type Definition 1.0• Smart Poster Record Type Definition 1.1• http://

developer.android.com/guide/topics/connectivity/nfc/index.html

• http://nfc-forum.org/• http://www.nfc.cc/ Page : 3

Page 4: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

Near Field Communication (NFC)

Page : 4

Page 5: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

Introduction to NFC

Page : 5

Page 6: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

NFC• NFC is a contactless communication

– In typical, the communication distance is less than 4 cm– Operation frequency is 13.56MHz– Killer applications: e-wallet, name card exchange, check-in, and so on– Related standards

• NFCIP-1 (ISO 18092 or ECMA 340)• NFCIP-2 (ISO 21481 or ECMA 352)

• NFC Operation Mode– Peer-to-Peer– Reader/Writer– Card Emulation

• NFC Tag– Simple: typically write-once– Complex: provide mathematical operations, hardware encryption– Sophisticated: provide computation environment

Page : 6

Page 7: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

NFC Operation Modes

Page : 7

Page 8: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

NFC Protocol Stack

Page : 8

Page 9: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

NFC Forum Tag Type• Type 1 (based on ISO 14443-A)

– Re-writable / write-protection– Memory size is between 96

bytes and 2 Kbytes– Speed: 106 Kbps– Vendor: Topaz (Broadcom)

• Type 2 (based on ISO 14443-A)– Re-writable / write-protection– Memory size is between 48

bytes and 2 Kbytes– Speed: 106 Kbps– Vendor: NXP

• Type 3 (based on JIS 6319-4, as known as FeliCa)– Pre-configured as re-writable or

read-only– Memory size is limited to 1 Mbytes– Speed: 212/424 Kbps– Vendor: Sony

• Type 4 (compliant with ISO 14443-A/B series)– Pre-configured as re-writable or

read-only– Memory size is limited to 32

Kbytes– Speed: 212/424 Kbps– Vendor: NXP

Page : 9

Page 10: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

NFC Data Exchange Format (NDEF)

Page : 10

Page 11: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

NFC Data Exchange Format (NDEF)

• NDEF Message Format

• Description– Each NDEF message is composed of multiple NDEF records (unbounded but limited

by memory size)– Each NDEF record can carry the data with size of 232-1 bytes

• If there is multiple NDEF records, the flag of message begin (MB) must be set as 1 in the first NDEF record.

• If there is multiple NDEF records, the flag of message end (ME) must be set as 1 in the last NDEG record.

• If there is only on NDEF records the flags of MB and ME must be set as 1 in the NDEG record.

– NDEF does not provide error handling, QoS, and other additional functionalities.Page : 11

NDEF Message

NDEF Record 1(MB=1)

NDEF Record 2…

NDEF Record n(ME=1)

Page 12: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

NDEF Record

Page : 12

• Flags– Message Begin (MB)– Message End (ME)– Chunk Flag (CF)– Short Record (SR)– ID Length (IL)

• Type Name Format (TNF)– Indicates the data type– Indicates how to read Type filed

• Type Length• ID Length• Payload Length• Type

– Indicates payload type

• ID (not tag ID)– Unique NDEF Message ID

• Payload– Actual data

7 6 5 4 3 2 1 0

MB ME CF SR IL TNF

Type Length

Payload Length 3

Payload Length 2

Payload Length 1

Payload Length 0

ID Length

Type

ID

Payload

Page 13: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

Short NDEF Record

Page : 13

7 6 5 4 3 2 1 0

MB ME CF SR = 1 IL TNF

Type Length

Payload Length

ID Length

Type

ID

Payload

Page 14: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

Type Name Format (TNF)

Page : 14

• Record Type Definition (RTD) in NFC Forum well-known type– Text– URL– Smart Post

Type Name Format Value

Empty 0x00

NFC Forum well-known type [NFC RTD; RFC 2141] 0x01

Media-type as defined in RFC 2046 [RFC 2046] 0x02

Absolute URI as defined in RFC 3968 [RFC 3968] 0x03

NFC Forum external type [NFC RTD] 0x04

Unknown 0x05

Unchanged 0x06

Reserved 0x07

Page 15: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

• NDEF record example of Text RTD

Page : 15

7 6 5 4 3 2 1 0

MB ME CF SR IL TNF = 0x01

Type Length = 0x01

Payload Length 3

Payload Length 2

Payload Length 1

Payload Length 0

ID Length

Type = “T”

ID

Payload

TNF: NFC Forum Well-known TypeText RTD

Page 16: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

TNF: NFC Forum Well-known Typecon’tText RTD

• Payload Structure

Page : 16

RTD Text Payload

0 1 … n n+1 … m

Status byte

IANA Language Code(Encoded by US-ASCII)

Text(Encoded by UTF-8 or UTF-16

depending on status bit)

Status byte

0 1 2 3 4 5 6 70: UTF-81: UTD16 0 The length of the IANA language code.

Page 17: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

TNF: NFC Forum Well-known TypeURI Service RTD

• NDEF record example of URI service RTD

Page : 17

7 6 5 4 3 2 1 0

MB ME CF SR IL TNF = 0x01

Type Length = 0x01

Payload Length 3

Payload Length 2

Payload Length 1

Payload Length 0

ID Length

Type = “U”

ID

Payload

Page 18: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

TNF: NFC Forum Well-known Typecon’tURI Service RTD

• Payload Structure

• ID Code

Page : 18

RTD URI Payload0 1 … n

URIID code

URI field encoded by UTF-8(The rest of the URI, or the entire URI if ID code is 0x00)

Hex. URL Prefix Hex. URL Prefix Hex. URL Prefix Hex. URL Prefix

0x00 N/A 0x0A sftps:// 0x14 pop: 0x1E urn:epc:id:

0x01 http://www. 0x0B smb:// 0x15 sip: 0x1F urn:epc:tag:

0x02 https://www. 0x0C nfs:// 0x16 sips 0x20 urn:epc:pat

0x03 http:// 0x0D ftp:// 0x17 tftp: 0x21 urn:epc:raw

0x04 https:// 0x0E dav:// 0x18 btspp:// 0x22 urn:epc:

0x05 tel: 0x0F news:// 0x19 btl2cap:// 0x23 urn:nfc

0x06 mailto: 0x10 telnet:// 0x1A btgoep:// … Reserved

0x07 ftp://anonymous:anonymous@ 0x11 imap 0x1B tcpobex://

0x08 ftp://ftp. 0x12 rtsp:// 0x1C irdaobex://

0x09 ftps:// 0x13 urn:// 0x1D dile://

Page 19: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

TNF: NFC Forum Well-known TypeSmart Post RTD – URL, SMS, Phone Number

Page : 19

• NDEF record example of Smart Post RTD7 6 5 4 3 2 1 0

MB ME CF SR IL TNF = 0x01

Type Length = 0x02

Payload Length 3

Payload Length 2

Payload Length 1

Payload Length 0

ID Length

Type = “Sp”

ID

Payload

Page 20: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

TNF: NFC Forum Well-known Typecon’tSmart Post RTD – URL, SMS, Phone Number

• The payload of Smart Post RTD is an NDEF message which is composed of multiple following specific NDEF records– URI record

• The core of Smart Poster.• MUST have one and only one URI record

– Title record• COULD have multiple title records with different languages

– Action record• Used to provide the recommendation of processing this service

– Icon record– Size record

• If URI record indicates a external entity, the size record which indicates the size of external entity to make sure the device is capable of handling this external entity.

– Type record• If URI record indicates a external entity, the type record is used to indicates the MIME type of

this external entity.

– Application-specific recordPage : 20

Page 21: Introduction to NFC

Ubiquitous Computing and Ambient Networking Laboratory

Q & A

Page : 21