Security in Smart Object Networks

Total Page:16

File Type:pdf, Size:1020Kb

Security in Smart Object Networks Security in Smart Object Networks MOHIT SETHI Degree project in Security and Mobile Computing Second cycle Stockholm, Sweden 2012 Aalto University School of Science Degree Programme of Computer Science and Engineering Mohit Sethi Security in Smart Object Networks Master's Thesis Espoo, June 30, 2012 Supervisors: Professor Tuomas Aura, Aalto University, Finland Professor Markus Hidell, Royal Institute of Technology, Sweden Instructors: Ari Ker¨anen,NomadicLab, Ericsson Research, Finland Jari Arkko, NomadicLab, Ericsson Research, Finland Aalto University School of Science ABSTRACT OF Degree Programme of Computer Science and Engineering MASTER'S THESIS Author: Mohit Sethi Title: Security in Smart Object Networks Date: June 30, 2012 Pages: 73 Professorship: Computer Science Code: T-110 Supervisors: Professor Tuomas Aura Professor Markus Hidell Instructors: Ari Ker¨anen,M.Sc. (Tech.) Jari Arkko, Licentiate (Tech.) Internet of Things (IoT) refers to an inter-connected world where physical devices are seamlessly integrated into the Internet and become active participants of business, information and social processes. This involves the inter-connection of a large number of heterogeneous networked entities and networks. Emergence of technologies such as Zigbee, Bluetooth low energy and embedded sensors has transformed simple physical devices into smart objects that can understand and react to their environment. Such smart objects form the building blocks for the Internet of Things. The communication infrastructure for these objects is based on an extension of the Internet protocol stack. Although the need for security is widely accepted, there is no clear consensus on how IP-based Internet security protocols can be applied to resource-constrained smart object networks. In this thesis, we develop a new secure and energy- efficient communication model for the Constrained Application Protocol (CoAP), a light-weight communication protocol designed for smart object networks. We contribute to the standardization of the generic communication architecture by adding security and delegation components for smart objects that sleep for large amounts of time during their operational phase. This architecture ensures data integrity and authenticity over a multi-hop network topology. It also provides a mirroring mechanism that uses a proxy to serve data on behalf of sleeping smart objects, thereby allowing them to act as always-online web servers. A working prototype implementation of the architecture is also developed. The security features in the architecture presented in this thesis are based on using strong public-key cryptography. Contrary to popular belief, our performance evaluation shows that asymmetric public-key cryptography can be implemented on small 8-bit micro-controllers without modifying the underlying cryptographic algorithms. Keywords: IoT, smart objects, security, CoAP, asymmetric cryptography, integrity, authenticity, mirroring mechanism Language: English ii Aalto-universitetet H¨ogskolan f¨or teknikvetenskaper SAMMANDRAG AV Examensprogram f¨or datateknik DIPLOMARBETET Utf¨ort av: Mohit Sethi Arbetets namn: S¨akerhet i smartobjektn¨atverk Datum: Den 30 Juni 2012 Sidantal: 73 Professur: Datateknik Kod: T-110 Overvakare:¨ Professor Tuomas Aura Professor Markus Hidell Handledare: Diplomingenj¨or Ari Ker¨anen Teknologie Licentiat Jari Arkko Internet of Things (IoT, \F¨orem˚alensInternet") syftar p˚aen sammankopplad v¨arld d¨ar fysiska apparater ¨ar s¨oml¨ost integrerade till Internet och blir aktiva deltagare i aff¨arslivs-, informations- och sociala processer. Detta innefattar sam- mankopplingen av ett stort antal heterogeniskt n¨atverkade enheter och n¨atverk. Uppkomsten av teknologier som Zigbee, l˚agenergi Bluetooth och inbyggda senso- rer har f¨orvandlat enkla fysiska apparater till smarta objekt som kan f¨orst˚aoch re- agera till sin omgivning. Dessa smarta objekt utg¨or byggstenarna f¨or F¨orem˚alens Internet. Kommunikationsinfrastrukturen f¨or dessa objekt bygger p˚aen utvidg- ning av internetprotokollstacken. Aven¨ om behovet av s¨akerhet ¨ar allm¨ant k¨ant, finns det inget konsensus om hur IP-baserade internets¨akerhetsprotokoll kan till¨ampas i resursbegr¨ansade smartob- jektn¨atverk. I denna avhandling utvecklas en ny s¨aker och energisn˚alkommuni- kationsmodell f¨or Constrained Application Protocol (CoAP, \Begr¨ansat applika- tionsprotokoll"), ett l¨att kommunikationsprotokoll avsett f¨or smartobjektn¨atverk. Avhandlingen bidrar till standardiseringen av den generiska kommunikationsar- kitekturen genom att tills¨atta s¨akerhets- och delegationskomponenter f¨or smarta objekt som sover under en stor del av sin operativa fas. Denna arkitektur ga- ranterar dataintegritet och autenticitet ¨over en flerhopps n¨atverkstopologi. Ar- kitekturen bidrar ocks˚amed en ˚aterspeglingsmekanism som anv¨ander sig av en proxyserver f¨or att erbjuda data f¨or sovande smarta objekts del, vilket l˚aterdem agera som alltid-online webbservrar. I avhandlingen utvecklas ocks˚aen fungeran- de prototypimplementation av arkitekturen. S¨akerhetsegenskaperna i den arkitektur som presenteras i denna avhandling ¨ar baserade p˚aanv¨andningen av stark publik-nyckel kryptering. I motsatts till den allm¨anna f¨orv¨antningen, visar prestationsbed¨omningen i denna avhandling att asymmetrisk kryptering med publik nyckel kan till¨ampas i 8-bitars mikrokon- trollrar utan att ¨andra p˚ade underliggande kryptografiska algoritmerna. Nyckelord: IoT, smarta objekt, s¨akerhet, CoAP, asymmetrisk kryptografi, integritet, autenticitet, ˚aterspeglingsmekanism Spr˚ak: Engelska iii Acknowledgements I sincerely thank Professor Tuomas Aura at Aalto University for his constant feedback and for providing the funding to attend the IETF 83 meeting, where I presented the initial results from the thesis. I am also grateful to Professor Markus Hidell for supervising the thesis at Royal Institute of Technology. I owe my gratitute to my instructors Ari Ker¨anenand Jari Arkko at Nomadic- Lab, Erisson Research for their regular guidance and advice during the course of my research work. I am indebted to my colleagues at NomadicLab for their continuous support. Finally, I would like to thank my family and friends for their moral support and motivation. Espoo, June 30, 2012 Mohit Sethi iv Abbreviations and Acronyms CoAP Constrained Application Protocol CoRE Constrained RESTful Environments DHCP Dynamic Host Configuration Protocol DLP Discrete Logarithmic Problem DNS Domain Name System DoS Denial of Service DTLS Datagram Transport Layer Security EAP Extensible Authentication Protocol ECC Elliptic Curve Cryptography ECDLP Elliptic Curve Discrete Logarithmic Problem ECDSA Elliptic Curve Digital Signature Algorithm EXI Efficient XML Interchange GPS Global Positioning System GSM Global System for Mobile Communications HIP Host Identity Protocol HIP-BEX HIP Base EXchange HIP-DEX HIP Diet EXchange HTTP Hyper-Text Transfer Protocol IETF Internet Engineering Task Force IKEv2 Internet Key Exchange Protocol version 2 IoT Internet of Things IPSec Internet Protocol Security JSON JavaScript Object Notation JOSE JavaScript Object Signing and Encryption JWK JSON Web Key JWS JSON Web Signature LWIG Light Weight Implementation Guidance MAC Media Access Control MP Mirror Proxy M2M Machine to Machine v NAT Network Address Translation nesC Network Embedded Systems C NIST National Institute of Standards and Technology NTP Network Time Protocol PAA PANA Authentication Agent PANA Protocol for Carrying Authentication for Network Access PGP Pretty Good Privacy RD Resource Directory REST Representational State Transfer RFID Radio-Frequency Identification RSA Rivest Shamir Adelman Cryptographic Algorithm RTT Round Trip Time SA Security Association SAAG Security Area Advisory Group SECG Standards for Efficient Cryptography Group SenML Sensor Markup Language SEP Sleeping End-point SIM Subscriber Identity Module SRAM Static Random Access Memory SSH Secure Shell SSL Secure Sockets Layer TLS Transport Layer Security UDP User Datagram Protocol URI Universal Resource Identifier URN Universal Resource Name UTF-8 Universal Character Set Transformation Format 8-bit WLAN Wireless Local Area Network XML Extensible Markup Language 6LoWPAN IPv6 based Low-Power Personal Area Networks vi Contents Abbreviations and Acronyms v 1 Introduction 1 1.1 Problem Area . .2 1.2 Research Goals and Methodology . .2 1.3 Structure of the thesis . .3 2 Background 4 2.1 Lifecycle of a Smart Object . .4 2.2 CoAP . .9 2.3 Link Format . 13 2.4 SenML . 13 2.5 Resource Directory . 15 2.6 Public-key Cryptography . 16 2.6.1 RSA . 16 2.6.1.1 RSA Signatures . 17 2.6.2 Elliptic Curve Cryptography . 17 2.6.2.1 ECDSA . 20 2.7 Javascript Object Notation (JSON) Object Signing and En- cryption . 21 2.7.1 JavaScript Object Notation (JSON) Web Key (JWK) . 22 2.7.2 JavaScript Object Notation (JSON) Web Signatures (JWS) . 22 3 Public-key Cryptography in IoT 24 3.1 Previous Experiments with Asymmetric Cryptography . 25 3.2 Available Cryptographic Libraries . 26 3.3 Performance Analysis . 28 4 Architecture 36 4.1 Mirror Proxy . 36 vii 4.2 Secure Communication . 38 4.3 Retrieving Data Updates . 39 4.4 Freshness . 40 4.5 Provisioning . 42 5 Implementation 44 5.1 Caching Data Updates . 45 5.2 Retrieving Data Updates . 47 5.3 Summary . 49 6 Discussion 50 6.1 Architecture Overview . 50 6.2 Evaluation of Methodology . 51 6.3 Security Considerations . 52 6.4 Reflections . 54 7 Conclusion 55 A Relic Configurations 70 B IETF 83 and Workshop on Smart Object Security 72 viii List of Tables
Recommended publications
  • Operating Systems and Applications for Embedded Systems >>> Toolchains
    >>> Operating Systems And Applications For Embedded Systems >>> Toolchains Name: Mariusz Naumowicz Date: 31 sierpnia 2018 [~]$ _ [1/19] >>> Plan 1. Toolchain Toolchain Main component of GNU toolchain C library Finding a toolchain 2. crosstool-NG crosstool-NG Installing Anatomy of a toolchain Information about cross-compiler Configruation Most interesting features Sysroot Other tools POSIX functions AP [~]$ _ [2/19] >>> Toolchain A toolchain is the set of tools that compiles source code into executables that can run on your target device, and includes a compiler, a linker, and run-time libraries. [1. Toolchain]$ _ [3/19] >>> Main component of GNU toolchain * Binutils: A set of binary utilities including the assembler, and the linker, ld. It is available at http://www.gnu.org/software/binutils/. * GNU Compiler Collection (GCC): These are the compilers for C and other languages which, depending on the version of GCC, include C++, Objective-C, Objective-C++, Java, Fortran, Ada, and Go. They all use a common back-end which produces assembler code which is fed to the GNU assembler. It is available at http://gcc.gnu.org/. * C library: A standardized API based on the POSIX specification which is the principle interface to the operating system kernel from applications. There are several C libraries to consider, see the following section. [1. Toolchain]$ _ [4/19] >>> C library * glibc: Available at http://www.gnu.org/software/libc. It is the standard GNU C library. It is big and, until recently, not very configurable, but it is the most complete implementation of the POSIX API. * eglibc: Available at http://www.eglibc.org/home.
    [Show full text]
  • Smart Market-Makers for the “Internet of Things”
    35 Wanted: Smart market-makers for the “Internet of Things” Ansgar Schlautmann, Didier Levy, Stuart Keeping and Gregory Pankert The “Internet of Things” is The “Internet of Things” is one of the hottest topics be- among the hottest topics ing debated today across industries worldwide. The most currently being debated, diverse products – home appliances, medical equipment, with the projected poten- cars and power meters, to name but a few – are getting tial in turnover whetting connected to the Internet. When products can thus com- the appetite of industry municate with the outside world, they are said to become experts around the globe. connected devices and smart objects: one can interact However, solution pro- with them remotely, query how they are doing and change viders are still searching their state as required. For example, a smart vital sign- for sustainable business monitoring device can connect a person who has a chronic models for this new field illness to a physician’s office, enabling telemedicine. The and offering their solu- combination of a smart object and the service exploiting its tions in a trial-and-error capabilities is called a smart solution. mode. In this article the authors explore alterna- Industry experts are outbidding each other when estimat- tive ways in which vari- ing the number of smart objects in homes, offices, facto- ous types of players can ries, vehicles and elsewhere. The estimates range from create value in this bud- 22 billion (IMS) to 50 billion (Cisco and Ericsson) by 2020, ding market. up from six billion today. Beecham Research predicts that global revenue from these objects will grow from $15 bil- lion in 2011 to more than $30 billion in 2014.
    [Show full text]
  • XL C/C++: Language Reference About This Document
    IBM XL C/C++ for Linux, V16.1.1 IBM Language Reference Version 16.1.1 SC27-8045-01 IBM XL C/C++ for Linux, V16.1.1 IBM Language Reference Version 16.1.1 SC27-8045-01 Note Before using this information and the product it supports, read the information in “Notices” on page 63. First edition This edition applies to IBM XL C/C++ for Linux, V16.1.1 (Program 5765-J13, 5725-C73) and to all subsequent releases and modifications until otherwise indicated in new editions. Make sure you are using the correct edition for the level of the product. © Copyright IBM Corporation 1998, 2018. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents About this document ......... v Chapter 4. IBM extension features ... 11 Who should read this document........ v IBM extension features for both C and C++.... 11 How to use this document.......... v General IBM extensions ......... 11 How this document is organized ....... v Extensions for GNU C compatibility ..... 15 Conventions .............. v Extensions for vector processing support ... 47 Related information ........... viii IBM extension features for C only ....... 56 Available help information ........ ix Extensions for GNU C compatibility ..... 56 Standards and specifications ........ x Extensions for vector processing support ... 58 Technical support ............ xi IBM extension features for C++ only ...... 59 How to send your comments ........ xi Extensions for C99 compatibility ...... 59 Extensions for C11 compatibility ...... 59 Chapter 1. Standards and specifications 1 Extensions for GNU C++ compatibility .... 60 Chapter 2. Language levels and Notices .............. 63 language extensions ......... 3 Trademarks .............
    [Show full text]
  • Section “Common Predefined Macros” in the C Preprocessor
    The C Preprocessor For gcc version 12.0.0 (pre-release) (GCC) Richard M. Stallman, Zachary Weinberg Copyright c 1987-2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation. A copy of the license is included in the section entitled \GNU Free Documentation License". This manual contains no Invariant Sections. The Front-Cover Texts are (a) (see below), and the Back-Cover Texts are (b) (see below). (a) The FSF's Front-Cover Text is: A GNU Manual (b) The FSF's Back-Cover Text is: You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development. i Table of Contents 1 Overview :::::::::::::::::::::::::::::::::::::::: 1 1.1 Character sets:::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.2 Initial processing ::::::::::::::::::::::::::::::::::::::::::::::: 2 1.3 Tokenization ::::::::::::::::::::::::::::::::::::::::::::::::::: 4 1.4 The preprocessing language :::::::::::::::::::::::::::::::::::: 6 2 Header Files::::::::::::::::::::::::::::::::::::: 7 2.1 Include Syntax ::::::::::::::::::::::::::::::::::::::::::::::::: 7 2.2 Include Operation :::::::::::::::::::::::::::::::::::::::::::::: 8 2.3 Search Path :::::::::::::::::::::::::::::::::::::::::::::::::::: 9 2.4 Once-Only Headers::::::::::::::::::::::::::::::::::::::::::::: 9 2.5 Alternatives to Wrapper #ifndef ::::::::::::::::::::::::::::::
    [Show full text]
  • Cheat Sheets of the C Standard Library
    Cheat Sheets of the C standard library Version 1.06 Last updated: 2012-11-28 About This document is a set of quick reference sheets (or ‘cheat sheets’) of the ANSI C standard library. It contains function and macro declarations in every header of the library, as well as notes about their usage. This document covers C++, but does not cover the C99 or C11 standard. A few non-ANSI-standard functions, if they are interesting enough, are also included. Style used in this document Function names, prototypes and their parameters are in monospace. Remarks of functions and parameters are marked italic and enclosed in ‘/*’ and ‘*/’ like C comments. Data types, whether they are built-in types or provided by the C standard library, are also marked in monospace. Types of parameters and return types are in bold. Type modifiers, like ‘const’ and ‘unsigned’, have smaller font sizes in order to save space. Macro constants are marked using proportional typeface, uppercase, and no italics, LIKE_THIS_ONE. One exception is L_tmpnum, which is the constant that uses lowercase letters. Example: int system ( const char * command ); /* system: The value returned depends on the running environment. Usually 0 when executing successfully. If command == NULL, system returns whether the command processor exists (0 if not). */ License Copyright © 2011 Kang-Che “Explorer” Sung (宋岡哲 <explorer09 @ gmail.com>) This work is licensed under the Creative Commons Attribution 3.0 Unported License. http://creativecommons.org/licenses/by/3.0/ . When copying and distributing this document, I advise you to keep this notice and the references section below with your copies, as a way to acknowledging all the sources I referenced.
    [Show full text]
  • Intelligent Traffic Information System Based on Integration of Internet Of
    (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 6, No. 2, 2015 Intelligent Traffic Information System Based on Integration of Internet of Things and Agent Technology Hasan Omar Al-Sakran Management Information Systems Department King Saud University Riyadh, Saudi Arabia Abstract—In recent years popularity of private cars is getting users. Through collected real-time traffic data, the system can urban traffic more and more crowded. As result traffic is recognize current traffic operation, traffic flow conditions and becoming one of important problems in big cities in all over the can predict the future traffic flow. The system may issue some world. Some of the traffic concerns are congestions and accidents latest real-time traffic information that helps drivers choosing which have caused a huge waste of time, property damage and optimal routes. Therefore, the system can precisely environmental pollution. This research paper presents a novel administrate, monitor and control moving vehicles. intelligent traffic administration system, based on Internet of Constructing an intelligent traffic system based on IoT has a Things, which is featured by low cost, high scalability, high number of benefits such improvement of traffic conditions, compatibility, easy to upgrade, to replace traditional traffic reduction the traffic jam and management costs, high management system and the proposed system can improve road reliability, traffic safety and independence of weather traffic tremendously. The Internet of Things is based on the conditions [1, 2]. Internet, network wireless sensing and detection technologies to realize the intelligent recognition on the tagged traffic object, Such traffic IoT must include every element of traffic such tracking, monitoring, managing and processed automatically.
    [Show full text]
  • Nesc 1.2 Language Reference Manual
    nesC 1.2 Language Reference Manual David Gay, Philip Levis, David Culler, Eric Brewer August 2005 1 Introduction nesC is an extension to C [3] designed to embody the structuring concepts and execution model of TinyOS [2]. TinyOS is an event-driven operating system designed for sensor network nodes that have very limited resources (e.g., 8K bytes of program memory, 512 bytes of RAM). TinyOS has been reimplemented in nesC. This manual describes v1.2 of nesC, changes from v1.0 and v1.1 are summarised in Section 2. The basic concepts behind nesC are: • Separation of construction and composition: programs are built out of components, which are assembled (“wired”) to form whole programs. Components define two scopes, one for their specification (containing the names of their interfaces) and one for their implementation. Components have internal concurrency in the form of tasks. Threads of control may pass into a component through its interfaces. These threads are rooted either in a task or a hardware interrupt. • Specification of component behaviour in terms of set of interfaces. Interfaces may be provided or used by the component. The provided interfaces are intended to represent the functionality that the component provides to its user, the used interfaces represent the functionality the component needs to perform its job. • Interfaces are bidirectional: they specify a set of functions to be implemented by the inter- face’s provider (commands) and a set to be implemented by the interface’s user (events). This allows a single interface to represent a complex interaction between components (e.g., registration of interest in some event, followed by a callback when that event happens).
    [Show full text]
  • INTRODUCTION to ANSI C Outline
    1/17/14 INTRODUCTION TO ANSI C Dr. Chokchai (Box) Leangsuksun Louisiana Tech University Original slides were created by Dr. Tom Chao Zhou, https://www.cse.cuhk.edu.hk 1 Outline • History • Introduction to C – Basics – If Statement – Loops – Functions – Switch case – Pointers – Structures – File I/O Louisiana Tech University 2 1 1/17/14 Introduction • The C programming language was designed by Dennis Ritchie at Bell Laboratories in the early 1970s • Influenced by – ALGOL 60 (1960), – CPL (Cambridge, 1963), – BCPL (Martin Richard, 1967), – B (Ken Thompson, 1970) • Traditionally used for systems programming, though this may be changing in favor of C++ • Traditional C: – The C Programming Language, by Brian Kernighan and Dennis Ritchie, 2nd Edition, Prentice Hall – Referred to as K&R Original by Fred Kuhns) Louisiana Tech University 3 Standard C • Standardized in 1989 by ANSI (American National Standards Institute) known as ANSI C • International standard (ISO) in 1990 which was adopted by ANSI and is known as C89 • As part of the normal evolution process the standard was updated in 1995 (C95) and 1999 (C99) • C++ and C – C++ extends C to include support for Object Oriented Programming and other features that facilitate large software development projects – C is not strictly a subset of C++, but it is possible to write “Clean C” that conforms to both the C++ and C standards. Original by Fred Kuhns) Original by Fred Kuhns) Louisiana Tech University 4 2 1/17/14 Elements of a C Program • A C development environment: – Application Source: application source and header files – System libraries and headers: a set of standard libraries and their header files.
    [Show full text]
  • C Language Features
    C Language Features 5.4 SUPPORTED DATA TYPES AND VARIABLES 5.4.1 Identifiers A C variable identifier (the following is also true for function identifiers) is a sequence of letters and digits, where the underscore character “_” counts as a letter. Identifiers cannot start with a digit. Although they can start with an underscore, such identifiers are reserved for the compiler’s use and should not be defined by your programs. Such is not the case for assembly domain identifiers, which often begin with an underscore, see Section 5.12.3.1 “Equivalent Assembly Symbols”. Identifiers are case sensitive, so main is different to Main. Not every character is significant in an identifier. The maximum number of significant characters can be set using an option, see Section 4.8.8 “-N: Identifier Length”. If two identifiers differ only after the maximum number of significant characters, then the compiler will consider them to be the same symbol. 5.4.2 Integer Data Types The MPLAB XC8 compiler supports integer data types with 1, 2, 3 and 4 byte sizes as well as a single bit type. Table 5-1 shows the data types and their corresponding size and arithmetic type. The default type for each type is underlined. TABLE 5-1: INTEGER DATA TYPES Type Size (bits) Arithmetic Type bit 1 Unsigned integer signed char 8 Signed integer unsigned char 8 Unsigned integer signed short 16 Signed integer unsigned short 16 Unsigned integer signed int 16 Signed integer unsigned int 16 Unsigned integer signed short long 24 Signed integer unsigned short long 24 Unsigned integer signed long 32 Signed integer unsigned long 32 Unsigned integer signed long long 32 Signed integer unsigned long long 32 Unsigned integer The bit and short long types are non-standard types available in this implementa- tion.
    [Show full text]
  • Choosing System C Library
    Choosing System C library Khem Raj Comcast Embedded Linux Conference Europe 2014 Düsseldorf Germany Introduction “God defined C standard library everything else is creation of man” Introduction • Standard library for C language • Provides primitives for OS service • Hosted/freestanding • String manipulations • Types • I/O • Memory • APIs Linux Implementations • GNU C library (glibc) • uClibc • eglibc – Now merged into glibc • Dietlibc • Klibc • Musl • bionic Multiple C library FAQs • Can I have multiple C libraries side by side ? • Can programs compiled with glibc run on uclibc or vice versa ? • Are they functional compatible ? • Do I need to choose one over other if I am doing real time Linux? • I have a baremetal application what libc options do I have ? Posix Compliance • Posix specifies more than ISO C • Varying degree of compliance What matters to you ? • Code Size • Functionality • Interoperability • Licensing • Backward Compatibility • Variety of architecture support • Dynamic Linking • Build system Codesize • Dietlibc/klibc – Used in really small setup e.g. initramfs • Bionic – Small linked into every process • uClibc – Configurable • Size can be really small at the expense of functionality • Eglibc – Has option groups can be ( < 1M ) License • Bionic – BSD/Apache-2.0 • Musl - MIT • Uclibc – LGPL-2.1 • Eglibc/Glibc – LGPL-2.1 Assigned to FSF • Dietlibc – GPLv2 • Klibc – GPLv2 • Newlib – some parts are GPLv3 Compliance • Musl strives for ISO/C and POSIX compliance No-mmu • uClibc supported No-mmu Distributions • Glibc is used in
    [Show full text]
  • An ECMA-55 Minimal BASIC Compiler for X86-64 Linux®
    Computers 2014, 3, 69-116; doi:10.3390/computers3030069 OPEN ACCESS computers ISSN 2073-431X www.mdpi.com/journal/computers Article An ECMA-55 Minimal BASIC Compiler for x86-64 Linux® John Gatewood Ham Burapha University, Faculty of Informatics, 169 Bangsaen Road, Tambon Saensuk, Amphur Muang, Changwat Chonburi 20131, Thailand; E-mail: [email protected] Received: 24 July 2014; in revised form: 17 September 2014 / Accepted: 1 October 2014 / Published: 1 October 2014 Abstract: This paper describes a new non-optimizing compiler for the ECMA-55 Minimal BASIC language that generates x86-64 assembler code for use on the x86-64 Linux® [1] 3.x platform. The compiler was implemented in C99 and the generated assembly language is in the AT&T style and is for the GNU assembler. The generated code is stand-alone and does not require any shared libraries to run, since it makes system calls to the Linux® kernel directly. The floating point math uses the Single Instruction Multiple Data (SIMD) instructions and the compiler fully implements all of the floating point exception handling required by the ECMA-55 standard. This compiler is designed to be small, simple, and easy to understand for people who want to study a compiler that actually implements full error checking on floating point on x86-64 CPUs even if those people have little programming experience. The generated assembly code is also designed to be simple to read. Keywords: BASIC; compiler; AMD64; INTEL64; EM64T; x86-64; assembly 1. Introduction The Beginner’s All-purpose Symbolic Instruction Code (BASIC) language was invented by John G.
    [Show full text]
  • Strlen Strcpy
    Strlen Description The strlen() function shall compute the number of bytes in the string to which s points, not including the terminating null byte. Return value The strlen() function shall return the length of s; the function has no failure mode and no error return. Prototype Declared in string.h size_t strlen(const char *s); Strcpy Prototype Declared in string.h In C90, the prototype is: char *strcpy(char *dest, const char *src); The C99 prototype is identical but adds the new restrict qualifiers: char *strcpy(char * restrict dest, const char * restrict src); Description The strcpy() function shall copy the null-terminated string pointed to by src to the memory pointed to by dest. Source and destination may not overlap. Return value The strcpy() function shall return the pointer dest; the function has no failure mode and no error return. Strcat Description The strcat() function shall append the null-terminated string pointed to by src to the null-terminated string pointed to by dest. The first character of src overwrites the null-terminator of dest. Source and destination may not overlap. Return value The strcat() function shall return the pointer dest; the function has no failure mode and no error return. Prototype Declared in string.h In C90, the prototype is: char *strcat(char *dest, const char *src); Strcmp Description The strcmp() function compares the string pointed to by s1 to the string pointed to by s2. Return value The strcmp() function returns an integer greater than, equal to, or less than zero, accordingly as the string pointed to by s1 is greater than, equal to, or less than the string pointed to by s2.
    [Show full text]